Ajax超时 [英] Ajax Timeouts

查看:44
本文介绍了Ajax超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨我在做ajax调用时需要帮助原型。所以这是我的JS

做ajax调用


var ajax1 = new Ajax.Request(

url,

{

方法:''得'',

参数:params,

onComplete:showResults,

onFailure:showFailure

}

);


此调用工作正常但我需要知道我是怎么做的可以设置一个超时说明

你应该放弃5秒后向用户显示如何实现这个消息。我希望在不更改任何代码的情况下实现这一目标

in prototype.js


有没有人知道如何使用prototype.js,我看了

在本文中, http:// www。 sergiopereira.com/articles/prototype.js.html

有没有人知道是否有图书馆的官方文件。


最后是有一个比原型更好的免费图库.js


谢谢

C

解决方案

Chaprasi写道:

嗨我在做ajax调用时需要帮助原型。所以这是我的
JS做一个ajax调用


Prototype.js通常被这个组中的大多数人避开。

你赢了'在这里找不到多少帮助。

此调用工作正常,但我需要知道如何设置超时
说5秒后你应该放弃并向其显示消息
用户如何实现这一目标。


我不知道原型是否支持超时,但我的AjaxRequest库

确实:
http://www.ajaxtoolbox.com/request/examples.php

有没有人知道是否有图书馆的官方文件。


prototype.js的一部分问题是文档几乎没有b $ b不存在,似乎没有一个好的支持系统对于

库。所以用户最终来到这里,例如,这很烦人。

最后有一个免费赠品库比prototype.js更好




是。很多:)


-

Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com


感谢您的回复。我知道我已经实现了prototype.js,但是我已经打开了很好的JS库,它可以完成所有包装来执行ajax。


所以你能说出一些这些库比

原型更好。


谢谢

C


Chaprasi在2006年5月23日下午3:16发表以下声明:

感谢您的回复。


感谢您引用将来回复的内容。


如果您想通过groups.google.com发布后续内容,不要使用

回复链接在文章的底部。点击显示选项在

文章的顶部,然后点击回复。在

文章标题的底部。

< URL: http://www.safalra.com/special/googlegroupsreply/ >

我知道我已经实现了prototype.js但是我很开心JS库
用于执行ajax的所有包装。

所以你能说出一些比原型更好的库。




*任何*库都比原型好。


< URL:http://www.ajaxtoolbox.com/>
< br $> b $ b -

兰迪

comp.lang.javascript常见问题 - http://jibbering.com/faq &新闻组每周

Javascript最佳实践 - http://www.JavascriptToolbox .com / bestpractices /


Hi I need help with prototype while doing ajax calls. So this is my JS
which does a ajax calls

var ajax1 = new Ajax.Request (
url,
{
method: ''get'',
parameters: params,
onComplete: showResults,
onFailure: showFailure
}
);

this calls works fine but i need to know how I can set a timeout saying
after 5 seconds you should give up and show a message to the user how
can this be achieved. I want to achieve this without changing any code
in prototype.js

Does any one have knowledge in using prototype.js to its best, I looked
at this article http://www.sergiopereira.com/articles/prototype.js.html
does anyone know if there is a official documentation for the library.

Last is there a freebie library better than prototype.js

Thank you
C

解决方案

Chaprasi wrote:

Hi I need help with prototype while doing ajax calls. So this is my
JS which does a ajax calls
Prototype.js is generally avoided by most people in this group.
You won''t find much help for it here.
this calls works fine but i need to know how I can set a timeout
saying after 5 seconds you should give up and show a message to the
user how can this be achieved.
I don''t know if prototype supports timeouts, but my AjaxRequest library
does:
http://www.ajaxtoolbox.com/request/examples.php
does anyone
know if there is a official documentation for the library.
Part of the issue with prototype.js is that the documentation is almost
non-existent and there doesn''t seem to be a good support system for the
library. So users end up coming here, for example, which is annoying.
Last is there a freebie library better than prototype.js



Yes. Many :)

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com


Thank you for the response. I know I implemeted prototype.js but I am
open to nice JS libraries which does all the wrapping for doing ajax.

So can you name a few of these libraries which are better than
prototype.

Thanks
C


Chaprasi said the following on 5/23/2006 3:16 PM:

Thank you for the response.
Thank you for quoting what you are replying to in the future.

If you want to post a followup via groups.google.com, don''t use the
"Reply" link at the bottom of the article. Click on "show options" at
the top of the article, then click on the "Reply" at the bottom of the
article headers.
<URL: http://www.safalra.com/special/googlegroupsreply/ >
I know I implemeted prototype.js but I am open to nice JS libraries
which does all the wrapping for doing ajax.

So can you name a few of these libraries which are better than
prototype.



*Any* library is better than prototype.

<URL: http://www.ajaxtoolbox.com/>

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/


这篇关于Ajax超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆