I have a JavaScript function "print_something", which is implemented in around 300 jsp help pages. I turned out this "print_something" function has to be corrected. So I am searching for a solution not to change 300 files.
I have one page where I open custom help page:
window.open('SomeHelpPage101.htm', 'Help', 'location=no,status=no,height=500,width=600,resizable,scrollbars');
I tryed to redefine function like this:
var jsObject = window.open('SomeHelpPage101.htm', 'Help', 'location=no,status=no,height=500,width=600,resizable,scrollbars');
jsObject.print_something() = function(){//corrected function}
It all works well in Firebug if I do step by step. But if I run the code it happens that window.open(...) is not yet finished because it is asynchronous so my redefine doesn't work.
How can I force window.open(...) to finish first and afterwards redefining print_something() would be sucessful.
Thank you very much in advance.