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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing JS code between frames

Status
Not open for further replies.

Rochenko

Programmer
Feb 15, 2002
7
GB
I have a site split into two frames, one defined in the frameset page as 'menu' (containing a navbar and some JS functions) and one defined as 'main'.

Some HTML and ASP pages that appear in the 'main' frame call the functions in the 'menu' frame by referencing the window object's 'top.' property, thus:

window.top.menu.(function)

When I was testing this on MS Personal Web Server, everything worked fine, and the functions in 'menu' operated. However, after uploading the site to a remote server, every time a page calls a function in 'menu', I get a

" 'window.top.menu' is null or not an object "

Javascript error. Why does this happen, when the HTML, ASP and JS is the same as it was when I was using PWS?
 
Do you have a link to the site? Is it possible that you are accessing information across domains? If so, IE security may be preventing you from using your scripts as you desire (cross-domain scripting). jared@eae.net -
 
If access is denied, IE will give the error: 'Access is Denied.'


When I test frames, I find that top.(frame) is indeed an [object Window].

Unless you are trying to access the page by itself while it is not entrapped within frames, I cannot find any reason why you would get a script error.
 
Thanks UNI MENT

That's what I thought, no good reason.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top