Domanda

all I simply want to do is; if the browser is less than internet explorer 8 find and remove $(document).foundation();

<!--[if IE 8]>
   //code here
<![endif]-->
È stato utile?

Soluzione

Simply deleting a plugin like that, e.g.

<!--[if lt IE 8]><!-->
<script>
  delete $.fn.foundation;
</script>
<!--<![endif]-->

Will probably cause all sorts of problems and is generally a bad idea - see here for why.

Instead, just load the foundation() plugin/related scripts if the browser is IE8+ or a different browser:

<!--[if gte IE 8]><!-->
<script src="/js/foundation.min.js"></script>
// Other related scripts etc...
<!--<![endif]-->
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top