ShareThis 小部件在 IE9 中会导致严重问题,因此我想为浏览器禁用它。您可以在下面看到 ShareThis 代码和我尝试禁用它的尝试。为什么if语句不起作用?如何为 IE9 禁用此代码?我感谢任何有用的意见或建议。
<script type="text/javascript">var switchTo5x=true;</script>
<script type="text/javascript"
src="http://w.sharethis.com/button/buttons.js"></script>
<script type="text/javascript" src="http://s.sharethis.com/loader.js"></script>
REST OF CODE
<script>
var options={ "publisher": "3662a59e-5e0d-4969-8567-735aca70d6d1",
"position": "left", "ad": { "visible": false, "openDelay": 5,
"closeDelay": 0}, "chicklets": { "items": ["facebook", "twitter",
"linkedin", "email", "pinterest", "sharethis"]}};
var st_hover_widget = new sharethis.widgets.hoverbuttons(options);
</script>
Bellow 是我尝试使用 if 语句禁用它。但是 ShareThis 仍然出现在 IE9 上。
<script type="text/javascript">
if (navigator.appName="Microsoft Internet Explorer")
{
}
else
{
<script type="text/javascript">
var switchTo5x=true;</script>
<script type="text/javascript"
src="http://w.sharethis.com/button/buttons.js"></script>
<script type="text/javascript" src="http://s.sharethis.com/loader.js"></script>
}
</script>
REST OF CODE
if (navigator.appName="Microsoft Internet Explorer")
{
}
else
{
<script>
var options={ "publisher": "3662a59e-5e0d-4969-8567-735aca70d6d1",
"position": "left", "ad": { "visible": false, "openDelay": 5,
"closeDelay": 0}, "chicklets": { "items": ["facebook", "twitter",
"linkedin", "email", "pinterest", "sharethis"]}};
var st_hover_widget = new sharethis.widgets.hoverbuttons(options);
</script>
}
</script>