畅言一家独大的后果就是无耻无底线,想加多少广告位加多少广告位。下面来说说彻底去掉这些广告位的方法。
PC模板网发现,畅言的广告是通过上图红圈里的js文件显示广告的,我们只需要把上面的js文件修改成不带畅言广告的js文件就行了。
上图可以看到,pcmoban把畅言里自带的js文件修改成了pcmoban本地的js文件,这样所有的广告就全部消失了。
畅言去广告js代码
(function () { if (window.changyan !== undefined || window.cyan !== undefined) { return; } var createNs = function () { if (window.changyan !== undefined) { return; } else { window.changyan = {}; window.changyan.api = {}; window.changyan.api.config = function (conf) { window.changyan.api.tmpIsvPageConfig = conf; }; window.changyan.api.ready = function (fn) { window.changyan.api.tmpHandles = window.changyan.api.tmpHandles || []; window.changyan.api.tmpHandles.push(fn); }; window.changyan.ready = function (fn) { if (window.changyan.rendered) { fn && fn(); } else { window.changyan.tmpHandles = window.changyan.tmpHandles || []; window.changyan.tmpHandles.push(fn); } } } }; var createMobileNs = function () { if (window.cyan) { return; } window.cyan = {}; window.cyan.api = {}; window.cyan.api.ready = function (fn) { window.cyan.api.tmpHandles = window.cyan.api.tmpHandles || []; window.cyan.api.tmpHandles.push(fn); }; }; var loadVersionJs = function () { var loadJs = function (src, fun) { var head = document.getElementsByTagName('head')[0] || document.head || document.documentElement; var script = document.createElement('script'); script.setAttribute('type', 'text/javascript'); script.setAttribute('charset', 'UTF-8'); script.setAttribute('src', src); if (typeof fun === 'function') { if (window.attachEvent) { script.onreadystatechange = function () { var r = script.readyState; if (r === 'loaded' || r === 'complete') { script.onreadystatechange = null; fun(); } }; } else { script.onload = fun; } } head.appendChild(script); }; var ver = +new Date() + window.Math.random().toFixed(16); var protocol = (('https:' == window.document.location.protocol) ? "https://" : "http://"); var url = 'http://www.lol9.cn/style/changyan/version-v3.js?' + ver; loadJs(url); }; createNs(); createMobileNs(); loadVersionJs(); }());
亲们可以打开上面的js文件链接,下载到你网站目录里去,然后在畅言代码里修改成你本地的js文件地址,就可以彻底删除畅言广告了。
然后在下面调用本地JS。
<div id="SOHUCS" sid="3250" ></div> <script charset="utf-8" type="text/javascript" src="/style/changyan/changyan.js" ></script> <script type="text/javascript">window.changyan.api.config({appid: 'cyt5fQ6kv',conf: 'prod_b6064ded9ebf02ef76754862f773a644'});</script>