function FindProxyForURL(url, host) {
if (/google/i.test(host)) return proxy;
.......
}
function FindProxyForURL(url, host) {
if (/google/i.test(host)) return proxy;
.......
}
|
1
语法赶脚怪怪的。。。
|
|
faceairSep 21, 2015
2
如果 host 里面有 google 字样就直接代理
|
|
4
搜到了答案,自问自答一下:
if(/google/i.test(host))拆开来写 re = /google/i; 定义正则表达式用来匹配 google, i 表示不区分大小写 if(re.test(host)) 判断 host 是不是匹配 google ref: http://bbs.csdn.net/topics/320061843 |
|
TinkSep 22, 2015
5
还能这么写?万能的啊
|