Click to See Complete Forum and Search --> : <APPLET><PARAM...> What is it ???
mini_dumbo
01-12-2003, 03:18 PM
Could any one please help ... :confused:
We are currently looking at some code which we can't too understand. Here are the format:
<APPLET>
<PARAM name="..." ... >
<PARAM ... >
<PARAM ... >
</APPLET>
What is the use of "PARAM"??? What is it ??? There's some tutorial from the internet, but we just can't understand it.
And we also realise there are so many different names used there. Do they have any special meanings ??? Or only user defines it like what we did for other tag, say <input> ???
Bo & Vic :)
khalidali63
01-12-2003, 10:35 PM
with param you pass a javascript value to your applets init method.
say you had
<script>
var name = "Khalid Ali";
var address="Calgary,Alberta"
</script>
<applet code="myApplet.class" height=100 width=100>
<param name="name">
<param name="address">
</applet>
in the applets init method
you can get these values like this
String name = getParameter("name");
String address= getParameter("address");
now in your applet name will have the value from javascript "Khalid Ali"
and address "Calgary,Alberta"
I hope this helps you understand it
Khalid
jeffmott
01-13-2003, 01:07 AM
khalidali63
with param you pass a javascript value
PARAM doesn't necessarily just pass a JavaScript value (in fact I'm not sure where it is documented that this should be the expected behaviour at all), but PARAM is meant to supply initial values to the Java applet defined in APPLET.
DEPRECATED EXAMPLE:
<applet code="bubbles.class" width="500" height="500">
<param name="how_many" value="25">
Java applet that draws animated bubbles.
</applet>
khalidali63
01-13-2003, 03:00 AM
khalidali63
with param you pass a javascript value to your applets init method
Please read "init" method
jeffmott
but PARAM is meant to supply initial values to the Java applet
My point is that I did say that values are passed to applet at the initial level.I wonder what your response has accomplished????????
Just a pointer.
Khalid
jeffmott
01-13-2003, 03:17 AM
khalidali63
Please read "init" method
Please provide a link where you would like me to read this from.
khalidali63
I wonder what your response has accomplished
Corrected an error in your post. I though that much would have been a little obvious.
In fact according to the Java documentation, if the value attribute is omitted, a JavaScript variable is not used, but instead returns null.
http://java.sun.com/j2se/1.3/docs/api/java/applet/Applet.html#getParameter(java.lang.String)
khalidali63
01-13-2003, 04:01 AM
Now that is correct.
I missed the value attributes..my bad.
Khalid