<p>场景还原:给a标签绑定了一个click事件用来触发ajax请求,在IE6中,请求时常会被中断,在非IE6中都一切正常。</p>
<pre class="brush: c-sharp">
&lt;a href="javascript:;" id="btn"&gt;click me&lt;/a&gt;
&lt;script type="text/javascript" src="jquery.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
&nbsp;&nbsp;var url = 'http://api.flickr.com/services/' +
&nbsp;&nbsp;&nbsp;&nbsp;'feeds/photos_public.gne?tags=car&amp;' +
&nbsp;&nbsp;&nbsp;&nbsp;'tagmode=any&amp;format=json&amp;jsoncallback=?';
&nbsp;&nbsp;$( '#btn' ).click(function(){
&nbsp;&nbsp;&nbsp;&nbsp;$.getJSON( url, function( data ){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert( data );
&nbsp;&nbsp;&nbsp;&nbsp;}); &nbsp;&nbsp;});
&lt;/script&gt;
</pre>
阅读全文 »
- 17th 03 2012
- JavaScript
- ajax, 默认事件