How would i check if the users browser is IE? i have this code here but it is not working.
if($.browser.msie && $.browser.version <= 9)
{
alert('You Are Using An Outdated Browser! Switch To Chrome Or FireFox.');
}
How would i check if the users browser is IE? i have this code here but it is not working.
if($.browser.msie && $.browser.version <= 9)
{
alert('You Are Using An Outdated Browser! Switch To Chrome Or FireFox.');
}
Try this solution by James Padolsey:
There are other interesting solutions in the comments as well.
How about the MS recommended way: http://msdn.microsoft.com/en-us/library/ms537509(v=vs.85).aspx
(And of course the UserAgent can be spoofed... but, if someone is spoofing their UserAgent do you really care about what they see on your site?)
Just a reminder (even thought not directly answers the question); it is always better to user feature detection as opposed to browser detection.
This is why Modernizr is there for;
So you would use it like;
Modernizr.canvas ? showGraph() : showTable();
Test for features, not browsers. If you use and require FormData like you've stated in your comments, then change your check to:
browser
was removed in 1.9.: