Good day to all.
I have the following setup:
A page with html, js, etc. (usual stuff) and an iFrame. In the iFrame I have a function that do something (anything.. alert(‘test’); for example).
I need to run that function if I click on a button on the main page.
For example if I push button alert in the main page, in the iFrame must appear an alert with the ‘test’ word.
document.frames[n]make frames accessible by the order they appear in the document.so
document.frames[0].contentWindow.myFunction()would call your function inside the frame in case the iframe is the only frame.Calling a function in the main window from the frame works via
topliketop.myFunction(). If you just want to go one level up you useparent.