首先我们了解一下几种location.href的区别简单的说:几种location.href的区别js实现网页被iframe框架功能,感兴趣的朋友可以了解下 首先我们了解一下:window.location.href.location.href.self.location.href.parent.location.href.top.location.href他们的区别与联系,简单的说:几种location.href的区别 js实现网页被iframe框架功能 "window.location.hr…
http://www.jb51.net/article/34942.htm 收集利用Jquery取得iframe中元素的几种方法 : 父页面访问子页面 $(document.getElementById('tabiframe0').contentWindow.document.body).find('.subscription').text() 测可用…
实际上,document 和 window 这两个对象的区别已经包含了这个问题的答案. document 表示的是一个文档对象,window 表示一个窗口对象. 一个窗口下面可以有很多的document对象.每个document 都有 一个URL. 但是,这不是所有的区别.当你ctrl + F5 一个链接 http://yourhost.com/#fragment 打印 alert(document.URL ); 和 alert(window.location.href); 发现,这两个的值不一…
一般情况下我们很少用到iframe(框架),但有些特殊的情况下我们不得不使用iframe,那么或许或遇到嵌套内容不全屏,网页周围有边框,双滚动条等等情况,下面来说一下处理技巧. 全屏与边框处理: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Colin-iframe Test</…
/* *parent.html */ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-e…
疑惑:window.location='url'  与window.lcoation.href='url'效果一样,都会跳转到新页面,区别在哪?查得的资料如下: 1:window.location是页面的位置对象,window.location.href是 location的一个属性值,并且它是location的默认属性就是说对window.location直接赋值一个url实际上就是对window.location.href赋值2: The Window.location read-only…
实际上,document 和 windows 这两个对象的区别已经包含了这个问题的答案. document 表示的是一个文档对象,windows 表示一个窗口对象.  一个窗口下面可以有很多的document对象.每个document 都有 一个URL. 但是,这不是所有的区别.当你ctrl + F5 一个链接 http://www.jbxue.com/#server 打印 alert(document.URL ); 和 alert(windows.location.href); 发现,这两个的…
1. js如何判断是否在iframe中 //方式一 if (self.frameElement && self.frameElement.tagName == "IFRAME") { alert('在iframe中'); } //方式二 if (window.frames.length != parent.frames.length) { alert('在iframe中'); } //方式三 if (self != top) { alert('在iframe中'); }…
top.location.href和localtion.href有什么不同 top.location.href=”url”          在顶层页面打开url(跳出框架) self.location.href=”url”         仅在本页面打开url地址 parent.location.href=”url”     在父窗口打开Url地址 this.location.href=”url”     用法和self的用法一致      if (top.location == self.l…
window.location.href.location.href是本页面跳转 parent.location.href是上一层页面跳转 top.location.href是最外层的页面跳转 举例说明: window.location.href.location.href: 例:  代码如下 复制代码 window.location.href= 'wapsend1.asp?zimu=A&rev= '   +   form1.rev.value ; parent.location.href:C页…