首页 > 代码库 > js 技巧

js 技巧

用于浮窗跳转至父窗口

parent.document.location.href=http://www.mamicode.com/‘parent.document.location.href = ‘/xxx/xxx.htm‘;

取父窗口的元素

window.parent.$(‘#xxx‘);

正常跳转

window.location.href = http://www.mamicode.com/‘/xxx/xx.htm‘;

设置定时跳转

window.setTimeout(function(){
  parent.document.location.href = http://www.mamicode.com/‘/xxx/xxxx.htm‘;
},1200)

 

js 技巧