Use jquery to send AJAX requests, which are normal under Google's browser, but fail under IE, and the first code is this:
The code is as follows |
Copy Code |
<script type= "Text/javascript" > $ (function () { $ ("#fen_a a"). Live ("Click", Function (event) { url=$ (This). attr ("href"); alert (URL); $.ajax ({ Url:url, Type: "Post", DataType: "HTML", timeout:1000, Error:function () { Alert ("Ajax fetch failed!") "); }, Success:function (Result) { $ ("#dapei_fenye"). Empty (). Append ($ (Result)-Find ("#dapei_fenye"). html ()); }, }); Event.preventdefault (); }); }) </script> |
This code is measured in Google Browser normal, under IE is not valid, if the Ajax paragraph removed, ie can see the contents of alert, Ajax Plus to go, even the contents of alert does not show. So OK is Ajax there is a problem here.
After several debugging, finally adjusted. Adjusted the error, and success the position of the two callback functions, the last callback function of the last "," comma removed, OK.
It seems that jquery's syntax is very strict under IE. The final code is as follows:
The code is as follows |
Copy Code |
<script type= "Text/javascript" > $ (function () { $ ("#fen_a a"). Live ("Click", Function (event) { url=$ (This). attr ("href"); $.ajax ({ Url:url, Type: "Post", DataType: "HTML", timeout:1000, Success:function (Result) { $ ("#dapei_fenye"). Empty (). Append ($ (Result)-Find ("#dapei_fenye"). html ()); }, Error:function () { Alert ("Ajax Fetch data failed!") "); } }); Event.preventdefault (); }); }) </script>
|
IE real people have a headache ah!!