I want to add a variable and add something to a functions content.
var variable1;
function myFunction() {
alert(variable1);
return variable1;
}
I want to change that to:
var variable1;
var variable2;
function myFunction() {
alert(variable1);
alert(variable2);
return variable1;
}
I want that the changes are applied to a my main html file so that the next time the page is called the changes are in effect.
I already have a Servlet that can produce a new html page but I don't know how to change the JavaScript part of an already existing page.
Edit: so basically I need something like:
request.getFunction(myFunction).addBeforeReturn(alert(variable2));