Jump to content

xmlhttp


napsternapster

Recommended Posts

Hi ppl,

 

Problem

The validateServer() function it calls executeAjax using false and works well with all other browsers but not firefox.On firefox submits without geting the response from the server and when I use true it does not work at. I need a way to make sure this function wirks well in all browsers the same way.

 

var server_error  //its a global variable 
function validateServer()
{
executeAjax(urlinfo_input,"GET","info_type_select","info_type_input","type_error");
executeAjax(urlinfo_input,"GET","group_type_select","group_type_input","group_error");
executeAjax(urlinfo_input,"GET","detailed_type_select","detailed_type_input","detailed_error");
executeAjax(urlinfo_input,"GET","detailed_identifiers_select","detailed_identifiers_input","identifier_error");	

    if(server_error == 0)
   {
f.submit();
//alert("counter = 0");
   }
}
[\code]

[code]

function executeAjax(url,method,select_id,input_id,error_id)
{
var xmlhttp = new GetXmlHttpObject();

if(method == 'GET')
{
	xmlhttp.open(method, url, false);
	xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
	xmlhttp.onreadystatechange = function()
	{
		if(xmlhttp.readyState == 4 && xmlhttp.status == 200)
		{
			if(xmlhttp.responseText != 0)
			{
				server_error = server_error + 1;
				document.getElementById(error_id).innerHTML = xmlhttp.responseText;
				document.getElementById(select_id).style.background = 'red';
				document.getElementById(input_id).style.background = 'red';
			}
		}
	}
	xmlhttp.send(null);
}
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.