Problem with HTML Parser in IE

后端 未结 9 925
醉梦人生
醉梦人生 2020-12-24 05:56

I am trying to create a dialog box that will appear only if the browser selected is IE (any version) however I get this error:

Message: HTML Parsing E

9条回答
  •  忘掉有多难
    2020-12-24 06:39

    A current version of https://apis.google.com/js/plusone.js caused this bug on IE8 in one of my sites.

    Easiest solution - remove google+.

    Easy solution - wrap the code in jquery's document.ready -function or similar:

    $(document).ready(function(){
         var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
         po.src = 'https://apis.google.com/js/plusone.js';
         var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
    });
    

提交回复
热议问题