sooxin-JAVA

Where does the target="" go when using location.href=""?

By default when using location.href="fileName.html", the target is the current document.

When coding location.href="fileName.html" what we are actually coding is document.location.href="fileName.html" or self.location.href="fileName.html", the self specifies the current window, or window.location.href="fileName.html".

When we need to target another window we need to navigate the window object hierarchy, either by specifying the parent frame, or the top frame (which may in fact be the same thing).

top.location.href="fileName.html" targets the top document.

top.frameName.location.href="fileName.html" targets the frame frameName within the top document.

parent.location.href="fileName.html" targets the parent of the current document.

parent.frameName.location.href="fileName.html" targets the child frame frameName of the parent of the current document, i.e. a sibling frame.

Feedback on 'Q18 Where does the target="" go when using location.href=""?'

posted on 2007-06-15 17:21 sooxin 阅读(404) 评论(0)  编辑  收藏 所属分类: JAVA


只有注册用户登录后才能发表评论。


网站导航: