I am trying to run a JQuery function based on whether or not the user is running IE. The reason is because the function that I have does not work in IE, so I have another one I would like to run instead when the user is using IE. I am running JQuery 1.9.1, so I cannot use $.browser
. I'm trying to use conditional comments, but I'm not sure if that is the way to go. I've tried to implement it here, but it doesn't work: http://jsfiddle.net/AsQ4E/
This is the HTML
<!--[if IE]>
<input type="button" onclick="javascript:ie();" value="Click Me!" />
<![endif]-->
<!--[if !IE]> -->
<input type="button" onclick="javascript:notIE();" value="Click Me!" />
<!-- <![endif]-->
This is the JQuery
function ie() {
alert("You are using IE");
}
function notIE() {
alert("You are not using IE");
}
How can I get this to work? Is this the best way to go about it?
EDIT: I am trying to use SVG Crowbar. When the user clicks a button, Crowbar extracts an SVG from the page and pops up a download for it. Here is the link to it: http://nytimes.github.io/svg-crowbar/. The problem is is that it doesn't work in IE, so I was going to use this only when the user is using IE: http://bl.ocks.org/biovisualize/1209499 (This works in IE). I don't know enough about programming and Javascript to debug the problem with IE.