Jump to content

simple send


user4fun

Recommended Posts

Onclick function getinfo is ranit sends var picked to get_def.phpget_def.php prints $found_defthe text area needs to be updated??What am i doing wrong?

function GetInfo(){   document.getElementById('text').value = "Loading...";	init_ajax();	xmlHttp.onreadystatechange = changetext;	var picked = document.getElementById('choice').value;	xmlHttp.open("GET", ","get_def.php?choice=" + picked,true);	xmlHttp.send(null); }function changetext()		{		 document.getElementById('text').value = xmlHttp.responseText;		}	   </script>

Link to comment
Share on other sites

var xmlHttp;function init_ajax(){  try  {	xmlHttp=new XMLHttpRequest();  }  catch (e)  {	try	{	  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");	}	catch (e)	{	  try	  {		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");	  }	  catch (e)	  {		alert("Your browser does not support AJAX!");	  }	}  }}

That is it

Link to comment
Share on other sites

You have a slight syntax error on the xmlHttp.open() line, it should look like

xmlHttp.open("GET", "get_def.php?choice=" + picked,true);

Link to comment
Share on other sites

You should get FireFox and FireBug, together they will debug your JavaScript at runtime, so you can pick up errors immediately.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...