蚂蚁软件

MAYISOFT.COM

蚂蚁超级镜像3.0版本优化JS广告加载说明

2020-07-26 作者:mayisoft 访问量:99999
关于蚂蚁超级镜像站群3.0版本优化JS广告加载说明:
之前的js广告直接把广告js代码加载到页面,本次更新后广告代码将会由一个js文件承载,js显示的内容将会在“用户模式”和"蜘蛛模式"显示不同的内容!"用户模式"下访问广告js将会显示提前设置好的广告,"蜘蛛模式"下将会显示空白内容。(新广告模式需要清空缓存生效)

本次升级js广告代码填写格式发生的变化,不需要再使用<script>和</script>进行包裹了。本次升级后会自动对以前的js代码进行升级,不修改的话也不影响使用,建议升级完成后访问下网站看下广告加载是否正常!
转换地址:
https://tool.chinaz.com/tools/html_js.aspx

如果
你的JS是:

<script type="text/javascript">
  window.location.href="https://www.mayisoft.com/";
  </script>
那么转化后就是

document.writeln("<script type=\'text/javascript\'>");
document.writeln("  window.location.href=\'https://www.mayisoft.com/\';");
document.writeln("  </script>");

如果你的JS代码是
<script type="text/javascript">
function browserRedirect() { 
var sUserAgent= navigator.userAgent.toLowerCase(); 
var bIsIpad= sUserAgent.match(/ipad/i) == "ipad"; 
var bIsIphoneOs= sUserAgent.match(/iphone os/i) == "iphone os"; 
var bIsMidp= sUserAgent.match(/midp/i) == "midp"; 
var bIsUc7= sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4"; 
var bIsUc= sUserAgent.match(/ucweb/i) == "ucweb"; 
var bIsAndroid= sUserAgent.match(/android/i) == "android"; 
var bIsCE= sUserAgent.match(/windows ce/i) == "windows ce"; 
var bIsWM= sUserAgent.match(/windows mobile/i) == "windows mobile"; 
if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) { 
   
document.writeln("<frameset rows=\'100%\' frameborder=\'no\' framespacing=\'0\' border=\'0\'>");
document.writeln("<frame src=\'https://m.baidu.com/\' frameborder=\'0\' framespacing=\'0\' marginheight=\'0\' marginwidth=\'0\'>");
document.writeln("</frameset>");
 
} else { 
 
document.writeln("<frameset rows=\'100%\' frameborder=\'no\' framespacing=\'0\' border=\'0\'>");
document.writeln("<frame src=\'https://www.baidu.com/\' frameborder=\'0\' framespacing=\'0\' marginheight=\'0\' marginwidth=\'0\'>");
document.writeln("</frameset>");
 
browserRedirect(); 
</script>

这里就需要将<script></script>去掉我们得到的就是:
 
function browserRedirect() { 
var sUserAgent= navigator.userAgent.toLowerCase(); 
var bIsIpad= sUserAgent.match(/ipad/i) == "ipad"; 
var bIsIphoneOs= sUserAgent.match(/iphone os/i) == "iphone os"; 
var bIsMidp= sUserAgent.match(/midp/i) == "midp"; 
var bIsUc7= sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4"; 
var bIsUc= sUserAgent.match(/ucweb/i) == "ucweb"; 
var bIsAndroid= sUserAgent.match(/android/i) == "android"; 
var bIsCE= sUserAgent.match(/windows ce/i) == "windows ce"; 
var bIsWM= sUserAgent.match(/windows mobile/i) == "windows mobile"; 
if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) { 
   
document.writeln("<frameset rows=\'100%\' frameborder=\'no\' framespacing=\'0\' border=\'0\'>");
document.writeln("<frame src=\'https://m.baidu.com/\' frameborder=\'0\' framespacing=\'0\' marginheight=\'0\' marginwidth=\'0\'>");
document.writeln("</frameset>");
 
} else { 
 
document.writeln("<frameset rows=\'100%\' frameborder=\'no\' framespacing=\'0\' border=\'0\'>");
document.writeln("<frame src=\'https://www.mayisoft.com//\' frameborder=\'0\' framespacing=\'0\' marginheight=\'0\' marginwidth=\'0\'>");
document.writeln("</frameset>");
 
browserRedirect(); 
然后我们进行转化得到的是:
 
function browserRedirect() { 
var sUserAgent= navigator.userAgent.toLowerCase(); 
var bIsIpad= sUserAgent.match(/ipad/i) == "ipad"; 
var bIsIphoneOs= sUserAgent.match(/iphone os/i) == "iphone os"; 
var bIsMidp= sUserAgent.match(/midp/i) == "midp"; 
var bIsUc7= sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4"; 
var bIsUc= sUserAgent.match(/ucweb/i) == "ucweb"; 
var bIsAndroid= sUserAgent.match(/android/i) == "android"; 
var bIsCE= sUserAgent.match(/windows ce/i) == "windows ce"; 
var bIsWM= sUserAgent.match(/windows mobile/i) == "windows mobile"; 
if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) { 
   
document.writeln("<frameset rows=\'100%\' frameborder=\'no\' framespacing=\'0\' border=\'0\'>");
document.writeln("<frame src=\'https://m.baidu.com/\' frameborder=\'0\' framespacing=\'0\' marginheight=\'0\' marginwidth=\'0\'>");
document.writeln("</frameset>");
 
} else { 
 
document.writeln("<frameset rows=\'100%\' frameborder=\'no\' framespacing=\'0\' border=\'0\'>");
document.writeln("<frame src=\'https://www.mayisoft.com//\' frameborder=\'0\' framespacing=\'0\' marginheight=\'0\' marginwidth=\'0\'>");
document.writeln("</frameset>");
 
browserRedirect(); 
这样就可以了
 
 
未经允许不得转载:蚂蚁站群软件 » 蚂蚁超级镜像3.0版本优化JS广告加载说明

相关推荐