PDA

View Full Version : external applet ? like .js


Richard
03-25-2003, 02:04 PM
Is there a way of having java applet code in a file like javascript in .js ?

For example, <script language="JavaScript" src="xyz.js"></script>

cg9com
03-25-2003, 02:08 PM
no, i dont think so.
mainly because Java, and javascript are 2 different languages.
if im not mistaken, applets must be compiled in some way?

Nightfire
03-25-2003, 06:02 PM
Erm, applets are external files and you do include applets like you do external js files, except you don't use <script etc> you use <applet code="MyApplet.class" width=200 Height=100>
</applet>
Occassionally you'll see the <param > tag used with applets, this is only to give you more 'freedom' and more control over what you want the applet to do

Is this what you meant or am I completely missing something?

liorean
03-25-2003, 06:07 PM
Well, except that you really should use object tags, not applet tags...

Richard
03-25-2003, 06:50 PM
No I meant is there a way to have all the parameters in one file (xyz.txt):

<param name="speed" value="9" />
<param name="direction" value="fromright" />
<param name="pause" value="0" />
<param name="stopat" value="1" />
<param name="font" value="Verdana, Arial, Helvetica, Sanserif" />
<param name="fontsize" value="11" />


etc and then just have this on the page for example:

<applet code="tick.java" codebase="file" archive="tick.jar" width="360" height="16" paramsloc="xyz.txt"></applet>

If so what would 'paramsloc' be and would the file extension have to be anything inparticular ?

pardicity3
03-25-2003, 10:42 PM
Hmm...I stink when it comes to js and applets, but it seems that maybe some kind of serverside include could do the trick. Just save all the params to a .txt file then include that file using PHP, ASP, SSI, or anything else you can think of. Does that work?