Issue Regarding jQuery.noConflict with I.E. Browser
i have an issue regarding jQuery.noConflict with I.E. browser version 7, version 8, and version 9 compatibility view.
in rest browser this script work in flow but above browser execute script totally opposite. i have tried the following example. You please check n tell me solution to run my this script on all browser of I.E. If possible please share ideas. Following is my program :
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
// Handler for .ready() called.
alert("First");
});
</script>
<script type="text/javascript" src="js/jquery-1.3.1.min.js"></script>
<script type="text/javascript">
var $j = jQuery.noConflict();
$j(document).ready(function () {
alert("Second");
});
</script>
as shown above when i run this script in mozilla, chrome , safari or IE9 it will prompt me First and Then Second. But in IE7, IE8 and IE9 compact view it will prompt me second and then first. Please help me in r开发者_开发技巧esolving.
Thanks
You are loading two different versions of jQuery; They work completely independently. The order of .ready()
callback execution is arbitrary between them. (Apparently reliable, but arbitrary.) You can't rely on it to be any order, and the fact that it seems to work in some browsers today does not mean that it will work there tomorrow.
Your best bet is to get the whole page working with one version of jQuery. If you can't, try to at least get all your ready()
handlers under one version of jQuery.
Issue Solved. i have put setTimeout method for both Ready function.
精彩评论