I know that I can access any function in a parent window from an iFrame by saying window.parent.whateverFunctionItIs(); provided that the parent document does indeed contain a function named whateverFunctionItIs.
The question is, how do I create such an object within an iFrame like I would normally create by using something like object1 = new ObjectMaker(); given that ObjectMaker exists in the parent document.
Creating a javascript object within an iFrame by accessing the parent window
90 views Asked by HolyResistance At
1
The answer is,
object1 = new window.parent.ObjectMaker();Possible mistake for beginners,
object1 = window.parent.new ObjectMaker(); // WRONG!