Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Running applet by clicking a hyperlink

 
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
 
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.
 
Why is the word "abbreviation" so long? And this ad is so short?
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic