Hey
I have a program in retrieving data from a HTML page with Javascript using Java. Lets say I have the structure of
C:/index.html
C:/js/script.js
index.html contains:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript" src="js/script.js"></script>
</head>
<body>
<a href="javascript:void(0);" id="add"><img src="images/menunew.png" alt="plus" border="0" /></a>
</body>
</html>
The script.js contains:
var Script = Class.create({
a:4,
b:5,
add: function(){
return (this.a + this.b);
}
});
How can from a Java servlet access a and b from the script.js file (which contains a class named Script) and also access the function add which returns that value?
(Note that the code I just wrote might be incorrect as I wrote it quickly just to demostrate whats my problem)
This is driving me crazy as I have tried with Map and retrieve it thru request but nothing. There isnt any way I see right now.
Thanks.