I need to to trigger a JavaScript function in an opener window by clicking a button in the child.
I thought the following would work, but it is not.
window.opener.MyFunction()
I need to to trigger a JavaScript function in an opener window by clicking a button in the child.
I thought the following would work, but it is not.
window.opener.MyFunction()
Are both windows on the same domain (e.g. foo.com?) It might be blocked due to reasons of cross-site scripting security.
It turns out that MyFunction() was inside a jQuery document.ready statement. It worked fine after I changed that. Interesting though, window.opener.close() still does not work.