1
zyAndroid 2012 年 11 月 20 日
location.host
|
2
bitsmix 2012 年 11 月 20 日
window.location.hostname === 'v2ex.com' ? (window.location.href = 'http://' + window.location.hostname + ':88' + window.location.pathname): console.log('oops')
|
3
SAGAN 2012 年 11 月 20 日
|
4
NemoAlex 2012 年 11 月 20 日
if (location.host == 'www.baidu.com') location.href = location.href.replace('//www.baidu.com/', '//www.baidu.com:88/');
|
5
Julyyq 2012 年 11 月 20 日 var oHost=location.host;
var setUrl=""; if(oHost.indexOf("baidu") !=-1) { var oUrl=location.href.replace(/baidu.com/,"baidu.com:88") setUrl=oUrl; } 拿去吧,不用谢。 |
7
jacy OP 谢谢上面几位。准备在路由器上劫持百度,可是80端口的http服务器不支持php,我准备用php做点文章。
|