May282012

How can I run JavaScript code in an HTML file?

BHARAT GUPTA asks:

I want to be able to run JavaScript code in an HTML file using Java code. The HTML file is being downloaded by using a Java program but I cannot get to run those JavaScript codes which are generating a few more elements thereafter. I want to run the two functions: unloadHandler1(event); & unloadHandler(); using Java code.

 


Browser: Chrome 17
System: Windows
Tagged: , , , ,

Comments for this Question are closed.

If you are looking for help, please ask a new question here.

We will be happy to help you!

2 Answers -

0 votes

Mike

May 28, 2012

I’m not exactly a programmer so I can’t really give you an experts answer but to give you something:

JavaScript is a client side scripting language.

You said the HTML file is downloaded by an Java Application therefor it is up to this application to properly execute the JavaScript within.

Being part of the HTML file I can only assume that the Java application needs to run a full browser engine e.g. Webkit in order to properly process the HTML and JavaScript.

0 votes

Oron

May 28, 2012

Java, or JavaScript? They’re not the same language, and are embedded differently!