I have the following sample html file:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Example</title>
<script src="../Scripts/jquery-2.0.3.js"></script>
<!--<script src="../Scripts/jquery-1.7.js"></script>-->
<script type="text/javascript">
$(document).ready(function () {
$('#mainheader').css("color", "red");
});
</script>
</head>
<body>
<h1 id="mainheader" class="header">Sample 1</h1>
<h2 class="header info">Sample 2</h2>
<h3 class="info">Sample 3</h3>
</body>
</html>
When i run the same with jQuery version 2.0.3, it runs into error:
Unhandled exception at line 834, column 4 in /Scripts/jquery-2.0.3.js
0x800a01b6 - Microsoft JScript runtime error: Object doesn't support this property or method
At the line: // Use the handy event callback document.addEventListener( "DOMContentLoaded", completed, false );
But if I run with a lower version of it i.e., 1.7, it works fine...
However the above code works perfectly fine for both versions on Chrome.
Can you please help me out with the differences:
Thanks & Regards.
Those improvements come at a price, though: jQuery 2.0 won't support Internet Explorer 6, 7, or 8.
If you need to support older browsers like Internet Explorer 6-8, Opera 12.1x or Safari 5.1+, use jQuery 1.12.
Cross-browser compatibility — jQuery supports older browsers which do not do well with modern tools, frameworks or libraries. jQuery-powered applications work well on all browsers.
Nevertheless, Native javascript is one of the best jQuery alternatives, in fact, It is the framework of JS. Javascript is the best because any browsers ships with javascript and you do not need to install jQuery in your application.
At the moment jQuery 2.x " does not support Internet Explorer 6, 7, or 8"
From http://api.jquery.com/jQuery.browser/:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With