woolyg Posted October 12, 2008 Share Posted October 12, 2008 Hi all, Within an HTML page of mine, I have embedded an IFrame. Within the Iframe is a little snippet of JS code that calls a overlay, and displays something over the whole page. Problem is, the overlay DIV I want to call is actually housed on the main HTML page, not within the Iframe. Is it possible to getElementByID from a main page, when calling it from within an Iframe? I keep getting "divname is undefined" errors because the divname is not locate in the Iframe code. All input appreciated, Thanks. WoolyG Quote Link to comment Share on other sites More sharing options...
woolyg Posted October 12, 2008 Author Share Posted October 12, 2008 Found it - In my JS I used obj1 = parent.top.document.getElementById('overlay_1'); ..this calls the object from the parent frame, rather than attempting to call it from within the Iframe. Nice one! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.