I have a function that in a different frame that I need to override. In addition, I need to call the original function from within my override. To do so, I'm using the following:
myFrame.SomeFunction = (function () {
var originalSomeFunction = myFrame.SomeFunction;
return function(arg1, arg2, arg3) {
alert('In override!');
originalSomeFunction(arg1, arg2, arg3);
};
})();
When I execute this code, I get "Can't execute code from a freed script".
Thoughts? Is there a better way to do this? Testing in IE 6,7,8 and 9.