Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Running applet by clicking a hyperlink

 
srikanth narra
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I need to run an applet by clicking a hyperlink.The following is the piece of code which i tried.It opens a new window but the applet does not run.

function openAppletWindow() {
var win=window.open("","","location=0,menubar=0,resizable=0,toolbar=0,status=0,height=150,width=500");
win.document.writeln('<APPLET WIDTH=100 HEIGHT=100 NAME="applettohtml.html" CODE="applettohtml.class"</APPLET>');
}
</script>
<p><a href="javascript penAppletWindow()">Click here to start
Applet</a>
</p>

Arul has suggested me on this before.I am new to java and javascript.I dunno whether this is too simple.But i am not able to figure out what is going on...
Thanks.
Srikanth Narra
 
arul narayan
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The above works on a button click. In case of an hyperlink :
First, have an html (called first.html) like this:
<html>
<p><a href="applettohtml.html">Click here to start
Applet</a>
</p>
Next,in applettohtml.html have the code like this:
<html>
<applet code = "applettohtml.class" width = 100 height = 100>
</applet>
</html>
Now, run first.html and click the link to run the applet.
Remember to place first.html,applettohtml.html,applettohtml.class in the same directory.
Try it out and mail me back.
 
srikanth narra
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Arul,
I did it but it is still saying that class not found when the html is run in the browser.I appreciate your willingness to get back to me.
Thanks
Sri Narra.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic