Loading JavaScript conditional on IE?
Added by Artur Adib about 15 years ago
Hi there,
Some JavaScipt libraries have workarounds for Internet Explorer of the form:
<!--[if IE]><![endif]-->
I was wondering how I might be able to make such workarounds work in Wt?
WApplication already seems to offer a similar conditional statement for CSS (see useStyleSheet()), but not for JavaScript.
Any ideas?
Thanks!
-Artur
Replies (2)
RE: Loading JavaScript conditional on IE? - Added by Artur Adib about 15 years ago
I guess I found an undocumented WEnvironment method called ".agentIsIE()" that does the trick.
Alas, apparently the infamous excanvas.js library for jQuery IE compatibility conflicts with Wt...
-A.
RE: Loading JavaScript conditional on IE? - Added by Koen Deforche about 15 years ago
Hey,
It does not really conflict, but because of Wt's bootstrap, the library is not properly initialized since the canvas elements are only created after the library was loaded.
You can solve it by using the progressive bootstrap mode or by calling 'G_vmlCanvasManager.initElement(document.getElementById("tutorial"));' using doJavaScript().
Regards,
koen