Results 1 to 4 of 4
Thread: Java/Javascript
- 11-22-2010, 06:18 PM #1
Java/Javascript
I wanna create a simple Java/javascript applet.
I mean: An Java-applet who can call a javascript function in his html document.
HTML-document:
Applet:Java Code:<html> <head> <script type="text/javascript"> function theJFunction() { alert("Hello world"); } </script> </head> <body> <applet code="myApplet" width="500" height="500"></applet> </body> </html>
How can I call the javascript function from my applet?Java Code:public class myApplet extends java.applet.Applet { public void init() { //here to call the javascript function "theJFunction()" } }
- 11-23-2010, 02:46 PM #2
- 11-23-2010, 03:12 PM #3
I've allready seen that document but when I do
The page goes to another URL, I mean the browser thinks the page goes to another URL.Java Code:getAppletContext().showDocument (new URL("javascript:doAlert(\"" + msg +"\")")); }
And than I can't use the javascript command "onbeforeunload".
For the JSObject I don't have the libraries, and I can't find where to download them.
- 11-29-2010, 02:54 AM #4
Member
- Join Date
- Nov 2010
- Posts
- 1
- Rep Power
- 0
Similar Threads
-
javascript + java
By karq in forum JavaServer Pages (JSP) and JSTLReplies: 10Last Post: 10-19-2010, 10:40 PM -
java communicating with javascript
By sunyi000 in forum New To JavaReplies: 12Last Post: 08-10-2010, 07:44 AM -
HonoGenerate for Java,jsp,html,javascript,css
By jaapnap in forum Reviews / AdvertisingReplies: 0Last Post: 12-05-2009, 11:56 PM -
JSON from javascript to java servlet
By boss-tech in forum Java ServletReplies: 1Last Post: 09-18-2009, 08:27 AM -
JavaScript to Java Statement
By mutuah in forum Advanced JavaReplies: 0Last Post: 08-08-2007, 05:16 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks