Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DOM problem with Iframes

Status
Not open for further replies.

Nevermoor

Programmer
Jul 25, 2003
218
US
Hi,

I have a site that was initially developed on a Server 2000 box and was recently moved to a Server 2003 environment. While many of my asp pages work fine, one of the more complicated pages does not.

The page uses an iframe in a floating div to allow the user to enter additional information on some of their selections, and then sends that information back to the main page using window.top.document.getelementbyid().

Does anyone know why this code would suddenly stop working now that it's hosted on a different server?
 
Are BOTH pages hosted on the different server, or just one of them? You may be running into cross-domain security problems.

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Sorry, I was just typing in the question lazily.

On the page itself there'll be an input like
Code:
<input name="metricStr" id="met115" value="Str1_COMMA_Str2" type="hidden">

And in the page contained in the iframe there'll be a call like
Code:
var inStr = window.top.document.getElementById('met115').value;
var inputArray = inStr.split("_COMMA_");

This worked on the old server but on the new server when I try to use inputArray it says that it is null or not an object.

also, both pages are on the new server. The old server was for intranet hosting and the new one is an internet server.
 
I figured it out. The company that we registered the URL with (GoDaddy) was serving our page in a frameset, so I needed to go in and replace every call to window.top with window.top.frames[0].

Siiigh.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top