View Single Post
Old 07-09-2007, 04:16 PM   PM User | #5
NancyJ
Senior Coder

 
NancyJ's Avatar
 
Join Date: Feb 2005
Location: Bradford, UK
Posts: 3,162
Thanks: 19
Thanked 65 Times in 64 Posts
NancyJ will become famous soon enough
I've got the exact same problem in IE, except adding a random number to the url isnt helping, any ideas?

Code:
var xmlHttp
var field

function suggest_weight()
{
	frame = document.getElementById('users_frame_size')[document.getElementById('users_frame_size').selectedIndex].value;
	height_feet = document.getElementById('users_height_feet')[document.getElementById('users_height_feet').selectedIndex].value;
	height_inches = document.getElementById('users_height_inches')[document.getElementById('users_height_inches').selectedIndex].value;
	url = '/suggest_weight.php?frame='+frame+'&height_feet='+height_feet+'&height_inches='+height_inches;
	changeField(url, 'users_goal_weight');
	
}
function changeField(url,fieldName)
{
 	field = fieldName;
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url+'&rand='+Math.floor(Math.random()*100),true);
	xmlHttp.send(null);
} 

function stateChanged() 
{ 
 
	if (xmlHttp.readyState==4)
	{ 
		document.getElementById(field).value=xmlHttp.responseText;
	}
}

onload = function()
{
	try
	  {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	  }
	catch (e)
	  {
	  // Internet Explorer
	  try
	    {
	    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	    }
	  catch (e)
	    {
	    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	    }
	  }
	return xmlHttp;
}
__________________
http://www.hazelryan.co.uk
NancyJ is offline   Reply With Quote