ShareThis小部件在IE9中導致重大問題,所以我想爲瀏覽器禁用它。貝婁你可以看到ShareThis代碼和我試圖禁用它。爲什麼if語句不起作用?該代碼如何禁用IE9?我感謝任何有用的意見或建議。如何禁用IE9的ShareThis?
<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>
貝婁是我試圖用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>
你有什麼問題?以下是一些可能有所幫助的鏈接:https://getsatisfaction.com/sharethis/topics/ie9_issues-1891mj和http://stackoverflow.com/questions/3768539/sharethis-button-does-not-work-on-pages-加載-通AJAX。這也可能有所幫助:http://msdn.microsoft.com/en-us/library/ms537509%28v=vs.85%29.aspx – Peter 2012-07-16 08:28:53