Hi,
timwap@yahoo.co.uk wrote:[color=blue]
> Thanks again for the guidance. I feel I'm so close to getting this
> thing working but still keep falling down.
>
> Your JavaScript, although intimidating to the likes of me, does make
> sense. The bit I have trouble understanding is the following line.
>
> document.write( strAppletCode );[/color]
The method document.write() writes some HTML code into the current
document. This HTML code is then interpreted by the browser. It is
handled as if it was normal HTML code.
[color=blue]
> A few lines above is the command 'var strAppletCode =...' so I guess
> strAppletCode is a variable. It also looks like this variable will be
> loaded with the Applet code & name, width & height plus hour, min, sec
> & tone parameters.[/color]
The variable strAppletCode is a String of characters, which contains
exactly this code:
<APPLET CODE="ToneTrig.class" WIDTH="100" HEIGHT="100">
<PARAM NAME="hour" VALUE="HH">
<PARAM NAME="min" VALUE="MM">
<PARAM NAME="sec" VALUE="SS">
<PARAM NAME="tone" VALUE="TT">
</APPLET>
However, it is built dynamically, and the HH, MM, SS and TT are replaced
by (resp.) Hour, Minutes, Seconds and Tone chosen by the user.
[color=blue]
> So if I had selected a trigger time of 10:20:30 and the tone 'A' then
> strAppletCode would contain the following info:
> '<APPLET CODE="ToneTrig.class" WIDTH="100" HEIGHT="100">', 10, 20, 30,
> A[/color]
Rather:
<APPLET CODE="ToneTrig.class" WIDTH="100" HEIGHT="100">
<PARAM NAME="hour" VALUE="10">
<PARAM NAME="min" VALUE="20">
<PARAM NAME="sec" VALUE="30">
<PARAM NAME="tone" VALUE="A">
</APPLET>
[color=blue]
> Is this anywhere near right? I hope so ;)
>
> Then 'document.write( strAppletCode );' would pass this data to the
> applet. I have not been able to find any reference to the
> 'document.write' command in my Jscript manual. Thats if it is a
> command.[/color]
It doesn't pass it to the applet, it writes the HTML code for the
applet, including the parameters. The browser then starts the applet,
which gets the parameters (using getParameter, as you found out) and
handles them.
[color=blue]
> What do I need to put in my Applet to get it to recieve these
> variables? Is it the 'getParameter' command or something else? I
> suspect the latter.[/color]
I believe it should work fine.
[color=blue]
>
> Many thanks.[/color]
No probs,
Laurent
--
Laurent Bugnion, GalaSoft
Webdesign, Java, javascript
:
http://www.galasoft-LB.ch
Private/Malaysia:
http://mypage.bluewin.ch/lbugnion
Support children in Calcutta:
http://www.calcutta-espoir.ch