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 1723
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...
|
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...
|
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...
|
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...
|
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....
|
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...
|
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...
|
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....
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
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...
|
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...
|
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,...
|
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...
| |