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