Reputation: 10704
I have some code that works in IE.
try{
top.document.frames["myFrame"].compare();
}catch(err){
alert("This is not executed.");
}
which doesn't work in Chrome. How should i resolve it? I was thinking that you could do some thing such as
top.document.frames["myFrame"].compare() || /*google chrome variant*/ ;
Thanks gang! :)
Oh, what i am doing is selecting the frame "myFrame" and executing a function inside of said frame.
Edit: Added jQuery as a tag because there might be a way to do it that way as well
Edit: - the caught error in my example is:
TypeError: Cannot read property of "myFrame" of undefined
Upvotes: 1
Views: 5637
Reputation: 1490
The standard way to do that is this one:
window.frames["yourFrame"].yourFunction();
Upvotes: 3