方法一

var hrefValue = window.location.href; 
 alertUrls = ['abc.com', 'edf.com'];  
 for(key in alertUrls){ 
  if(String(hrefValue).indexOf(alertUrls[key]) >= 0){
   break; 
    }else{
 }

 

方法二

 

function tiaozhuan()
{
hrefValue = window.location.href; //获取当前页面的地址
var  alrUrls = ['sm.abc.com', '3g.abv.com', 'm.abc.com']; 
for(var i=0;i<=altUrls.length;i++)
{
if(String(hrefValue).indexOf(altUrls[i]) >= 0)
{
if(altUrls[i]=="sm.hkzhifa.com")
{
//break;
}
else if(altUrls[i]=="3g.hkzhifa.com")
{
//break;
}
                         else{
                              }
}
}
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-12
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-18
  • 2021-09-05
  • 2022-12-23
  • 2021-12-18
  • 2022-12-23
相关资源
相似解决方案