Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have implemented a simple browser in java which load a html page(I wrote it), I want to call my javascript function, in my java my class! I try the following code, but it didn't execute the script!
Java
browser.execute("<script type='text/javascript'> "
						+"loadMap("+lat+","+lng+");"
					    +"	</script>")

(browser is an instance of Browser )

so how can I execute my js function in java?
Posted
Comments
Anand Gunasekaran 15-Jul-14 5:00am    
trying to include that source javascript file.
browser.execute("<script type='text/javascript' src='somejs.js'> "
+"loadMap("+lat+","+lng+");"
+" </script>")
Coder93 15-Jul-14 5:20am    
It is internal js, also I separate html and js file, and include js source but it didn't work!

1 solution

I should do it like this:
browser.execute("loadMap("+lat+","+lng+");");
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900