473,721 Members | 2,220 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Ajax Timeouts

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

May 23 '06 #1
17 3298
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
May 23 '06 #2
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

May 23 '06 #3
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.c om, 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.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 23 '06 #4
Matt Kruse wrote:
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.


I haven't really looked at prototype.js - would you mind sharing why
it's generally avoided?
May 23 '06 #5
I am not trying to avoid it, I just was thinking if there are better
libraries who can give me handle over timeouts, onerrors.

So far AjaxRequest looks good which is available at
http://www.ajaxtoolbox.com/

Tony wrote:
Matt Kruse wrote:
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.


I haven't really looked at prototype.js - would you mind sharing why
it's generally avoided?


May 23 '06 #6
Tony wrote:
Matt Kruse wrote:
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.


I haven't really looked at prototype.js - would you mind sharing why
it's generally avoided?


In no particular order:

1. It modifies the protoype of some built-in objects so that
using say, for..in with an array object produces unexpected results.
2. It requires a different syntax, so that instead of using say:

var el = document.getEle mentById('someI D');

you use:

var el = $('someID');

Instead of looping through a number of IDs, you'd use:

var els = $('someID_01', 'someID_02', elRef_03);
3. Having used and become dependent on its syntax, you'll
have to learn 'real' JavaScript at some point.
4. It is utterly undocumented by the author and only very
sparsely commented. Some other attempts at documentation:

<URL:http://blogs.ebusiness-apps.com/jordan/pages/Prototype%20Lib rary%20Info.htm >
<URL:http://www.sergioperei ra.com/articles/prototype.js.ht ml>
<URL:http://wiki.script.acu lo.us/scriptaculous/show/Prototype>
<URL:http://www.snook.ca/archives/000531.php>
5. There is no support community or blog of any real substance
6. It has about 2,0000 lines of code when only a small subset
might be needed. It is not easy to use only portions,
as many functions are reliant on others. Those dependencies
are not documented.
7. Its feature detection is sparse and it is likely to fail in
many browsers with no chance of recovery
8. It encourages bad coding practice with functions like:

Try.these( func01(...), func02(...), func03(...) );

as a shortcut for multiple try..catch blocks and replacement
for feature detection.

And so on...
--
Rob
Group FAQ: <URL:http://www.jibbering.c om/faq/>
May 24 '06 #7
I'm not particularly pro prototype.js but

RobG wrote:
prototype.js
1. It modifies the protoype of some built-in objects so that
using say, for..in with an array object produces unexpected results.


Is the for..in loop problem still a problem or is that something they
have fixed?

5. There is no support community or blog of any real substance


It is possible to try on the rails spinoff list.
-Peter

May 24 '06 #8
pe**********@gm ail.com wrote:
I'm not particularly pro prototype.js but

RobG wrote:
prototype.js

1. It modifies the protoype of some built-in objects so that
using say, for..in with an array object produces unexpected results.


Is the for..in loop problem still a problem or is that something they
have fixed?


The official latest version is 1.4, I tested it with 1.5.0_rc0 (see 1.
below). Yes, it's still a problem and likely always will be.

The issue stems from the fact that prototype.js modifies the prototype
of the in-built Array object. The same functionality could have been
achieved by creating a special prototype.js array object (say called
PTArray or _$A or whatever) and modifying that, but that's not how the
author chose to do it.
1. There are 31 extra properties:

each, all, any, collect, detect, findAll, grep, include,
inject, invoke, max, min, partition, pluck, reject, sortBy,
toArray, zip, inspect, find, select, member, entries, _reverse,
_each, clear, first, last, compact, flatten, without
--
Rob
Group FAQ: <URL:http://www.jibbering.c om/faq/>
May 24 '06 #9
RobG wrote:
<snip>
2. It requires a different syntax, so that instead of
using say:

var el = document.getEle mentById('someI D');

you use:

var el = $('someID');

<snip>

That is also function name chosen with a disregard for the convention
laid out in the ECMAScript specification where all Identifiers beginning
with '$' are intended it indicate machine generated Identifiers. No
reasonable javascript code should be written without a regard for that
obviously well known/understood convention.

Richard.
May 24 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3290
by: p2esp | last post by:
Hello, I'm using the xmlrpclib module to contact an XMLRPC server that takes a long time to send results back. My client timeouts. The question is whether there is a way to have an xmlrpclib client that never timeouts. I have been searching for some code examples on how to do that, but I could not find any in the xmlrpclib
4
1771
by: Laphan | last post by:
Hi Guys I've been using text files for Tab-Delimited/ADO/ASP sites so that users can update and display their products lists through my system with relative ease. Only problem is that for the last few months or so, this system has been generating loads of timeouts. ISP has said that I should be looking to upgrade my system, as it is the mechanics of it that are creaking under the strain. My queries are:
2
1657
by: mircu | last post by:
Hi, I need a quick solution to make my application behave correctly when one of these timeouts occurs. I have some logic in session_start but when the authentication cookie timeouts the user is redirected to login page and after successful login the session is not started. I'd like to have one timeout and when it occurs the user must login and then the new session is started. TIA. Regards, mircu
2
363
by: Fraijo | last post by:
how can i disable session timeouts without affecting any program codings?
1
5234
by: AV | last post by:
I have a web server in production running IIS 6 (Windows Server 2003 SP1) and hosting multiple virtual websites with each website hosting many ASP.NET applications in virtual directories. Each website is running in it's own worker process and all the application use the out of process ASP.NET State Server running on the same webserver (eg. connecting to 127.0.0.1:42424). Now recently the following errors have been showing up in the...
5
20077
by: dougwig | last post by:
I'm trying to handle the scenario where a user's session times out and and their ajax request triggers a redirection by the webserver (302 error?). I'm using Prototype 1.4 and the my works great with Firefox,but with IE6 the onFailure never gets called and the request never completes. My code: var ajaxReq = new Ajax.Request( url, {method: 'post', parameters:
2
8060
by: webdevaccount | last post by:
Hello, I am using a Timer and an UpdatePanel control. The Timer is set to 1000 milliseconds, and therefore results in many server request timeouts error (logical). The Server Request Timeout error does not result in a redirection to a blank error page, but rather a pop-up message describing the error appears. My Question: Is there any way to catch this error and prevent it from being displayed?
1
1283
by: Lloyd Sheen | last post by:
It seems that debugging AJAX Web services is about impossible. I have googled and found the Sys.Net.WebRequestManager.set_defaultTimeout call. I set the value to 15000 which is supposed to be 15 seconds but I cannot perform anything in my webservice without timing out. I have a logging web service which works in IIS but again not with VS 2005 Pro / debugging. While debugging I am using the ASP.NET development server. Any ideas??
10
6173
by: Zytan | last post by:
I have a TcpClient. I set the read/write timeouts at 1 minute (in milliseconds). I get a NetworkStream from it and confirm the timeouts still exist. I do a NetworkStream.Write() and then a NetworkStream.Read(). Sometimes it sits and waits -- on the Write() or the Read() -- for 15 minutes before I get fed up and close the app..... I am not connecting to a TcpListener. I am connecting to a Socket with ProtocolType.Tcp, which is...
0
8730
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9367
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9131
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6669
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5981
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4484
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3189
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2130
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.