Hi All,
Ive been having a problem of late with one of my sites that uses PHP5 / Ajax. The problem is that periodically the ajax functions lock up and it gets stuck in the loading phase of the request. If i restart the apache server everything goes back to normal (i assume it severs the connection to the ajax called function).
I think this is a problem with the javascript part as i have tried it using a straight post request and have have no problems and slow loading time is localized to the one user (ie. still works fine on the other computers on my office network).
I have recorded this happening in Firefox, safari and IE6 & 7
My server is running debian with apache2 and php5
Just wondering if somebody can shed some light on what my problem may be?
Cheers
Will
2 1744
Hi All,
Ive been having a problem of late with one of my sites that uses PHP5 / Ajax. The problem is that periodically the ajax functions lock up and it gets stuck in the loading phase of the request. If i restart the apache server everything goes back to normal (i assume it severs the connection to the ajax called function).
I think this is a problem with the javascript part as i have tried it using a straight post request and have have no problems and slow loading time is localized to the one user (ie. still works fine on the other computers on my office network).
I have recorded this happening in Firefox, safari and IE6 & 7
My server is running debian with apache2 and php5
Just wondering if somebody can shed some light on what my problem may be?
Cheers
Will
Ok post your codes here with Code Tags.
And let us know it.
Debasis Jana
Ok post your codes here with Code Tags.
And let us know it.
Debasis Jana
Hi,
Here is my main ajax function
Cheers
Will -
-
function submitFormCustom(f, field1, field2, dable){
-
// disable form, or not
-
disable = true;
-
lastform = f;
-
if (disable === true) {
-
disable_form(f, true);
-
}
-
-
// re-id eval ajax part
-
if (document.getElementById('ajxjs')) {
-
document.getElementById('ajxjs').innerHTML = '';
-
document.getElementById('ajxjs').id = 'id_'+Math.random();
-
}
-
-
-
if(window.XMLHttpRequest){
-
var xmlReq = new XMLHttpRequest();
-
-
if (xmlReq.overrideMimeType) {
-
//set type accordingly to anticipated content type
-
//http_request.overrideMimeType('text/xml');
-
xmlReq.overrideMimeType('text/html');
-
}
-
} else if(window.ActiveXObject) {
-
-
try {
-
var xmlReq = new ActiveXObject("Msxml2.XMLHTTP");
-
} catch (e) {
-
try {
-
var xmlReq = new ActiveXObject("Microsoft.XMLHTTP");
-
} catch (e) {}
-
}
-
}
-
-
var formData = '', elem = '';
-
for(var s=0; s<f.elements.length; s++){
-
elem = f.elements[s];
-
if ((elem.type == 'checkbox' || elem.type == 'radio') && elem.checked == false) {
-
continue;
-
}
-
-
var selemval = '';
-
-
if (elem.tagName == 'SELECT' && elem.multiple === true) {
-
var selem = elem.getElementsByTagName('option');
-
for (i = 0; i < selem.length; i++) {
-
selemval = '';
-
if (selem[i].value != "" && selem[i].selected === true) {
-
if(formData != ''){
-
formData += '&';
-
}
-
selemval = selem[i].value;
-
formData += elem.name+"="+selemval.replace(/&/g, 'amp;');
-
}
-
}
-
} else {
-
if(formData != ''){
-
formData += '&';
-
}
-
selemval = elem.value;
-
formData += elem.name+"="+selemval.replace(/&/g, 'amp;');
-
}
-
}
-
-
if (formData != "") {
-
formData += "&xrand="+randomString(8);
-
}
-
-
-
-
xmlReq.onreadystatechange = function(){
-
if(xmlReq.readyState == 4){
-
-
if (content = xmlReq.responseText) {
-
-
if (trim_str(content) != "") {
-
try {
-
document.getElementById(field1).innerHTML = content;
-
}
-
catch (e) {
-
alert(document.getElementById(field1).innerHTML);
-
}
-
// evaluate JSON
-
if (document.getElementById('jsonjs')) {
-
try {
-
var json = eval("(" + document.getElementById('jsonjs').innerHTML + ")");
-
} catch (e) {
-
alert('Could not evaluate JSON '+e);
-
}
-
} // end eval JSON
-
// evaluate regular JS
-
if (document.getElementById('ajxjs')) {
-
try {
-
eval(document.getElementById('ajxjs').innerHTML);
-
}
-
catch (e) {
-
alert('Could not evaluate javascript '+e);
-
}
-
} // end eval js
-
if (disable === true) {
-
-
if (!document.getElementById('msgdivarea') && !document.getElementById('cbform')) {
-
disable_form(f, false);
-
}
-
-
if (resetform === true){
-
f.reset();
-
}
-
}
-
}
-
}
-
document.getElementById(field2).innerHTML = "";
-
blockoff = false;
-
} else if (xmlReq.readyState == 1) {
-
document.getElementById(field2).innerHTML = '<span class="ld">Loading ...</span>';
-
} else if (xmlReq.readyState == 3) {
-
document.getElementById(field2).innerHTML = '<span class="ld">Please wait ...</span>';
-
} else if (xmlReq.readyState == 2) {
-
document.getElementById(field2).innerHTML = "";
-
}
-
}
-
xmlReq.open(f.method, f.action, true);
-
xmlReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
-
xmlReq.setRequestHeader("Content-length", formData.length);
-
xmlReq.setRequestHeader("Connection", "close");
-
xmlReq.send(formData);
-
return false;
-
-
}
-
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: G Matthew J |
last post by:
interesting "signal vs. noise" blog entry:
http://37signals.com/svn/archives2/whats_wrong_with_ajax.php
|
by: Gaffar |
last post by:
Hello.
My name is Gaffar. I am handling an module in a Project. This application interface is slow and inefficient. So Client told "implement an AJAX Solution which will increase speed and efficiency and user's experience".
So, My problem is what is AJAX Solution. How to implement that. what are the feataures. Please give with a sample solution.
Thanx in advance.
Regards
Gaffar.
|
by: John Chan |
last post by:
Hi,
Im doing a maintenance application in ajax and coldfusion at work on IE6
exclusively. I have a save button on each form and i have to do various
validations server side and on client side when the user clicks save i.e
check that user exists in table, check users password is the same as
password in table, check password is valid, check that logged in user is a
super user etc etc to get the correct error message. Different forms may or...
|
by: BG Mahesh |
last post by:
hi
We are looking for a good Ajax library which has very good support for
iframe. The ones we have considered so far are,
Backbase.com - not happy with the speed
Zapatech.com - it is good but doesn't have support for iframe
openreco.org - it is good but doesn't support iframe
Any pointers is appreciated. We are doing the development on Linux.
|
by: =?Utf-8?B?Y2hpeDIz?= |
last post by:
Hi!!! I am having a hard time processing 20,000 records using AJAX. AJAX
threw an internet connection timeout. Is there any way that I can increase
the internet connection timeout by using web.config? I am using ASP.NET 1.1.
Thanks!!!
| |
by: =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?= |
last post by:
I'm about to finally make the jump and start a new site using AJAX. THe
question i have for all of you AJAX developers out there is which one?
1. The Standard AJAX frame work
2. The Tool kit.
3. Or are there others out there.
4. Should i not do AJAX at all because it still posts back the entire page
even though
only the section is refreshed. (someone tell me i'm wrong here and why
please!)
|
by: willl69 |
last post by:
Hi All,
Ive been having a problem of late with one of my sites that uses PHP5 /
Ajax. The problem is that periodically the ajax functions lock up and it
gets stuck in the loading phase of the request. If i restart the apache
server everything goes back to normal (i assume it severs the connection
to the ajax called function).
I think this is a problem with the javascript part as i have tried it
using a straight post request and have...
|
by: NetWave |
last post by:
Hi,
For my next project I'm going to need Ajax, so I'm in about to read some
books on ASP.NET Ajax.
While reading Rick Strahl's blog I stumbled upon jQuery. I've been to the
website and seen some examples, and it sure looks promising.
However, I'm not sure how it relates to ASP.NET Ajax. Do they complement
each other? Or are they concurrent products?
|
by: Tomasz J |
last post by:
Hello developers,
After migrating my web project application (using the old model) to .Net
Framework 3.5 and Ajax Control Toolkit release 20820 the Accordion control
no longer works correctly. In certain cases (only) it renders but is dead -
does not initialize. Before the migration it worked, no changes have been
made.
Here is the complete scenario description:
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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...
|
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...
|
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
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |