var url = "http//:www.baidu.com/" var name = "百度"; var iWidth = 1100;//弹窗宽度 var iHeight = 700; //弹窗高度 var iTop = (window.screen.availHeight - 30 - iHeight) / 2; var iLeft = (window.screen.availWidth - 10 - iWidth) / 2; window.open(url,…
问题: 首先,简单说一下关于301重定向的问题,最简单的理解就是,假设你的主机上绑定有 www.uilike.cn, uilike.cn, www.uiseo.cn三个域名,当你想输入 uilike.cn或者 www.uiseo.cn这两个域名的时候,网站自动跳转到主域名: www.uilike.cn 解决思路: 最为关键的两点: 1.301最大的好处就是传递权重,目的都是为了更好的保留权重.比如A网页由于永久改变网址,那么做301之后,把A页面永久性的转移到B页面,搜索引擎就会把网页B当做唯一…
首先介绍两个方法的语法: reload 方法,该方法强迫浏览器刷新当前页面.语法:location.reload([bForceGet])参数: bForceGet, 可选参数, 默认为 false,从客户端缓存里取当前页. true, 则以GET 方式,从服务端取最新的页面, 相当于客户端点击 F5("刷新") replace 方法,该方法通过指定URL替换当前缓存在历史里(客户端)的项目,因此当使用replace方法之后,你不能通过“前进”和“后退”来访问已经被替换的URL.语法:…
window.location.href  和  window.location.replace 的区别 1.window.location.href=“url”:改变url地址: 2.window.location.replace(“url”):将地址替换成新url,该方法通过指定URL替换当前缓存在历史里(客户端)的项目,因此当使用replace方法之后,你不能通过“前进”和“后 退”来访问已经被替换的URL,这个特点对于做一些过渡页面非常有用!…
1.代码最前面的分号,可以防止多个文件压缩合并以为其他文件最后一行语句没加分号,而引起合并后语法错误. 2.匿名函数(function(){})();:由于Javascript执行表达式是从圆括号里面到外面,所以可以用圆括号强制执行声明的函数.避免函数体内和外部的变量冲突. 3.$实参:$是jquery的简写,很多方法和类库也使用$,这里$接受jQuery对象,也是为了避免$变量冲突,保证插件可以正常运行. 4.window, document实参分别接受window, document对象,w…
使用js的同学一定知道js的location.href的作用是什么,但是在js中关于location.href的用法究竟有哪几种,究竟有哪些区别,估计很多人都不知道了. 一.location.href常见的几种形式 目前在开发中经常要用到的几种形式有: 1 2 3 4 5 6 self.location.href;//当前页面打开URL页面 window.location.href;//当前页面打开URL页面 this.location.href;//当前页面打开URL页面 location.h…
$(document).ready(function() { // endless scrolling $(window).scroll(function() { if($(window).scrollTop() + $(window).height() == $(document).height()) { $("body").append("<div class='item'><img src='path/to/image' width='140' hei…
Here Mudassar Ahmed Khan has explained how to pass value from child popup window to parent page window using JavaScript. The child popup window must be opened using JavaScript window.open function. And in such case we can access the parent page contr…
when ever i use window.location.href=//some url it always open a new window, this only happens when the parent window is an dialog box. what is wrong? window.open("http://asdf.com", "_self"); as suggested on this thread window.location…
今天早上我发现一个问题,当一个网页的地址最后面是一个#时(比如:http://www.baidu.com/go.asp#), 执行:window.location.replace(window.location.href); 浏览器不刷新页面. 经过测试: window.location.href = window.location.href; 浏览器也不刷新页面. 经过测试:window.location.reload() ; 浏览器会刷新页面. 以前经过一些测试发现 window.locat…