Forum Moderators: open

Message Too Old, No Replies

javapplets

         

rook

5:27 pm on Jul 14, 2008 (gmt 0)

10+ Year Member



Hello people of the forums,

Just found this place. I'm not webdude/dudette by trade, just a hobby. So, forgive me for my ignorance. Anyway, I'm running a random banner generator (java) and would like run the same script in a different local on the same page. I tried to copy the script and paste it into the page, but my original stops working. What is it that I do not know?

rocknbil

1:00 am on Jul 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome aboard rook! First, java and javascript are two different things. Javascript is a client-side scripting language ("client" meaning browser), executed from within the browser, and Java is a compiled language, much like C/C++. You create applets with Java that are included in a page via the object tag, much like you'd do with Flash.

If your script is javascript, the best bet is to paste some code here and someone may be able to help.

rook

4:54 pm on Jul 15, 2008 (gmt 0)

10+ Year Member



Thanx for the welcome rock! Anyway, here's the code. How can I run two of these on one page?

<script src="jpapplet.js" language="javascript" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
jpwriteapplet('<applet code="AdvBanner.class" archive="AdvBanner.jar" WIDTH="604" HEIGHT="227" mayscript>');
</script>

<!-- Applet Properties -->
<param name="Speed" value="100">
<param name="Pause" value="8">
<param name="random" value="true">

<!-- Banners -->
<!-- repeat the bannerN and linkN parameter to add more banners -->
<div id="Layer6" style="position:absolute; width:200px; height:44px; z-index:5; left: 208px; top: 896px;"></div>
<param name="banner1" value="images/gdpros.gif">
<param name="link1" value="http://www.somesite.com,_self">
<param name="banner2" value="images/overhead.gif">
<param name="link2" value="http://www.somesite.com,_self">
<param name="banner3" value="images/everydaybad.gif">
<param name="link3" value="http://somesite.com/signsup.htm,_self">

<a href=</a>
</applet></div>

Thank you to everyone who reads this & peace, love & happiness to those answer :O)

rocknbil

5:35 pm on Jul 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



So you are using both, Javascript AND Java! :-P

I would look at what's in jpapplet.js. See how it writes to the document via jpwriteapplet(). It may be writing by element ID. You can only have one element with a given ID; all id'ed elements must be unique. So if it writes the same ID twice, it may be that only the first one is valid, or by writing out the document it may set a global variable that precludes writing it again.

Second there may be something in the applet itself. Refer to the creator's documentation for help on that one.