Click to See Complete Forum and Search --> : window.href in a framed schema?


kusi
11-03-2003, 02:25 AM
1-Does it refer to the current frame window by default or to the top browser window by default?
It seems the current window is used.

2-can a page refer to the javascript function residing in another frame's current page just so: parent.frameName.js-function-name() and use?
it's sometimes working. but couldnot find out why not always.

AdamGundry
11-03-2003, 10:04 AM
1. I presume you mean window.location.href, in which case it refers to the current frame, which has its own window object. You can get the window object of the topmost frame (and hence the location) using window.top, and the window containing the frame using window.parent.

2. Yes, provided the two frames are in the same domain. If not, browser security restrictions prevent this from working.

Adam