javascript刷新与打开页面 2011年02月14日 try { = "youkuaiyun.com"; } //document.doamian 用来得到当前网页的域名 catch (ex) { }; function reLoad()//判断浏览器后 刷新 { var name = navigator.appName //返回浏览器的名称 var vers = navigator.appVersion //返回浏览器的代码名在基于Netscape的浏览器中,这个属性的值是"Netscape(火狐)"。在IE中,这个属性的值是"Microsoft Internet Explorer"。 if (name == 'Netscape') { window.location.reload(true) } else { history.go(0) } } function openPage(ev, url) {//打开页面 var element = ev.srcElement || ev.target; if (!element.parentNode) return; if (typeof document.all == "object") { var a = document.createElement("A"); a.target = "_blank"; a.href = url; document.body.appendChild(a); a.click(); setTimeout(function() { a.parentNode.removeChild(a); }, 50); } else window.open(url, "_blank"); }