博客:防止加载widgets.js(2015)
Blogger: Prevent loading of widgets.js (2015)
我在博客上有一个自定义网站,没有使用任何模板,只是常规代码。我的问题是widgets.js文件。它每次都被加载,虽然我不需要它。
问题是,在过去,很容易通过用<!--</body>--> </body>
替换</body>
标签来删除它
但是现在这个不再工作了,因为谷歌的cookie政策添加了一个评论。这是我在网页上得到的代码:
<!--<script type="text/javascript">
if (window.jstiming) window.jstiming.load.tick('widgetJsBefore');
</script>
<!-- 'Es liegt in Ihrer Verantwortung, Ihre Besucher über die in Ihrem Blog verwendeten Cookies zu informieren. Weitere Informationen finden Sie hier http://www.blogger.com/go/cookiechoices.' -->
<script src="/js/cookiechoices.js" defer></script>
<script>
Code for Bloggers Cookie Information that pops up on every page here
</script>
<script type="text/javascript" src="https://www.blogger.com/static/v1/widgets/2772432204-widgets.js"></script>
<script type='text/javascript'>
Some blogger script here, pretty long so I don't paste it.
</script>
</body>--> </body>
</html>
最初的意图是使整个脚本标签评论-但由于cookie政策的变化,谷歌添加了这个评论,至少在欧盟网站:
<!-- 'Es liegt in Ihrer Verantwortung, Ihre Besucher über die in Ihrem Blog verwendeten Cookies zu informieren. Weitere Informationen finden Sie hier http://www.blogger.com/go/cookiechoices.' -->
问题是——它被自动添加到博客上,"-->"阻止了黑客的有效攻击。我试过的:
禁用cookie通知:
cookieChoices = {};将国家更改为不从。com重定向到。de:
Var blog = document.location.hostname;Var slug = document.location.pathname;var ctl = blog.substr(blog.lastIndexOf("."));If (ctld != ".com") {Var NCR = "http://"+博客。substr (0, blog.indexOf("!");NCR += ".blogspot.com/ncr"+弹头;window.location.replace (ncr);}
这些都不起作用。我找了几个小时才找到答案。谢谢你阅读我的问题
使用此代码<!--</body>--></body>
或者试试这个
<!--</body>--><script>document.write="</bo"+"dy>";</script>
相关文章:
- 可以't让我的if语句处理js中的html表单输入
- 使用agility.js进行页面布局和合成
- 使用Clipboard.js复制span文本
- 使用JS如何动态更改显示的html文件中的文本背景颜色
- ES6 (ECMAScript 2015) 模块:导入索引.js
- JS:如何将字符串(“2015年3月10日”)转换为Date对象
- React.js和丰富的数据网格组件或至少是hack [2015]
- VS 2015与Gulp JS单元测试的集成
- 在Visual Studio 2013-2015中要求JS智能感知
- 如何在Stimulsoft Js 2015 Viewer中设置本地化
- 从2015年1月1日开始创建垂直时间线->D3.js中的31DEC15
- 使用IIS(非Express)将Visual Studio 2013(或2015)JS调试器附加到浏览器
- 在没有启用严格模式的情况下,如何在node.js v4.2.1中使用ECMAScript 2015
- 博客:防止加载widgets.js(2015)
- 需要帮助的日期使用时刻js (2015-06-02T00:00:00Z)
- VS 2015 -如何生成一个references.js文件
- VS 2015: JS文件中没有高亮和智能感知
- 如何使旧的JS CRM 2011适应CRM 2015
- 在Visual Studio 2015 + Node.js中显示JavaScript文件的导航栏
- 在“;2015-06-23“;使用Jquery/Js的格式