开心园地

导航

2012年4月10日 #

jquery getJSON 中对超时Timeout的处理

摘要: 调用 jquery1.4 的getJSON()方法时,如下代码就能处理当URL为非法URL,或者URL繁忙而不能返回响应、超时等状况。代码源自 http://stackoverflow.com/questions/4138470/jquery-getjson-with-timeoutfunction testAjax(){ varparams="test=123"; var isneedtoKillAjax =true;// set this true // Fire the checkajaxkill method after 10 seonds setTimeout.. 阅读全文

posted @ 2012-04-10 13:18 开心园地 阅读(5629) 评论(0) 推荐(0) 编辑