PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTML » HTML_AJAX » Bug #7821

Intenet Connection Problem

Details

Submitted2006-06-06 10:04 UTC
Fromnilesh dot kamani at gmail dot com
StatusBogus
PackageHTML_AJAX
PHP Version4.3.8
OSLinux
Roadmaps(Not assigned)

Comments

[2006-06-06 10:04 UTC] nilesh dot kamani at gmail dot com

Description:
------------
There is normal script in class file. I am just updating some tables and fetching some data. Simple script in browser side page also.

Expected result:
----------------
When Internet Connection goes down, I got the javascript error. It gives some long number and "could not allocate the specified resource. I want to just remove this problem.

Actual result:
--------------
I want to stop the further execution of script in browser, if it did not get any reply from server.

[2006-06-06 13:41 UTC] nilesh dot kamani at gmail dot com

I call an ajax method which return a response that will be used to update the page via javascript.
This method gets bound to an onload event, and then calls itself every 30 seconds.
If the internet connection goes down, it shows me javascript error as show in below image file.
http://www.jyve.com/bug.jpg

[2006-06-06 16:04 UTC] jeichorn at php dot net

Did you try adding a custom error handling and detecting that error, canceling your interval if its hit?

[2006-06-08 13:09 UTC] nilesh dot kamani at gmail dot com

Hello

I haven't written any custom error handling script.
Do You mean that I should not call that function again if the internet connection is down?
I have big Demo on weekend. Please help me in this.
script is as below.
It calls getUpdate() every 5 seconds.
Please tell me what I should do.
getUpdate()
{
strMessage = objLocal.getMessage();
if(strMessage)
{
/*
Parsing Script for strMessage
*/
}
setTimeout("getUpdate();",5000)
}

[2006-06-08 16:05 UTC] jeichorn at php dot net

Correct its up too you to manage error conditions, HTML_AJAX doesn't do it for you automatically.

If you set
HTML_AJAX.onError(error,request) {
// an error happened, display error messages cancel future requests etc
}

You should be able to handle it. If the error isn't being caught if you can give me reproducable steps i'll try to get that part fixed, but depending on the cause (which IE bug) that could take awhile

[2006-06-15 18:50 UTC] jeichorn at php dot net

Did adding an error handler work for you?

[2006-06-16 04:42 UTC] nilesh dot kamani at gmail dot com

yes... error handling works for me.
Thank you very much.
Thanks for providing this great PEAR class.