I have an event on the parent page that fires a javascript function, which in turn calls another function on the child iframe. Both pages are in the same domain, and I confirmed this if a JavaScript document is displayed on both pages at the same time.
This is what has worked for years and is offered in similar topics: windows.frames ["iframeID"] SomeFunction (). This stopped working with Internet Explorer version 8.0.7600.16385. It works in Internet Explorer version 8.0.6001.18702
I tried to replace it with each of them, and the result was the same: iframeName.somefunction (); document.frames ("iframeName") SomeFunction () .; top.frames [0] .somefunction ();
The indicated error: "Access is denied" and refers to the first bit of code in somefunction (), however somefunction () works fine if called inside the iframe itself.
Is there a new “right” way to call functions inside an iframe from the parent? Is there a workaround on the code side (I cannot control the user's browser)?
EDIT: here is the internal function: somefunction () {somebutton.click (); } If instead I use "alert (" something ");", it works without errors.
EDIT2: The newer version as well as IE9 Beta expanded it to also defeat the hacker workaround, so I returned to death in the water.
EDIT3: I forgot about it until someone posted almost a year later. This is the workaround I came across:
iframename.badscripthack();
iframe :
badscripthack()
{ document.getElementById( "OffscreenTextField" ) ().
}
submitthis()
{ document.getElementById( "SubmitButton" ) ().
}
:
, , . , "" . , "", ( , ).