I have the following html file example:
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Example</title> <script src="../Scripts/jquery-2.0.3.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 encounters an error:
Unhandled exception on line 834, column 4 in / Scripts / jquery -2.0.3.js
0x800a01b6 - Microsoft JScript Runtime Error: Object does not support this property or method
On line: // Use callback of useful event document.addEventListener ("DOMContentLoaded", completed, false);
But if I run a lower version, i.e. 1.7, it works fine ...
However, the above code works fine for both versions in Chrome.
Could you help me deal with the differences:
Thanks and respect.
jquery
Anil VK Babu
source share