How to display browser specific HTML?

后端 未结 9 636
遇见更好的自我
遇见更好的自我 2020-12-06 10:48

I\'m trying to find a way to display one link to an IE user and another link to all other browsers using javascript or conditional comments (or whatever it takes).

B

9条回答
  •  有刺的猬
    2020-12-06 11:48

    IE supports conditional compilation, which you can use to easily deliver IE-only code without needing to perform user agent sniffing or feature detection.

    /*@cc_on
       /*@if (@_jscript)
          alert("IE.");
       @else @*/
          alert("Not IE.");
       /*@end
    @*/
    

提交回复
热议问题