user4fun Posted December 1, 2007 Share Posted December 1, 2007 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 More sharing options...
Synook Posted December 1, 2007 Share Posted December 1, 2007 What does the init_ajax() function look like? Link to comment Share on other sites More sharing options...
user4fun Posted December 1, 2007 Author Share Posted December 1, 2007 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 More sharing options...
Synook Posted December 2, 2007 Share Posted December 2, 2007 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 More sharing options...
user4fun Posted December 2, 2007 Author Share Posted December 2, 2007 ??????????????????????????????//That is all I have to say about that?? lolThank you, I am an idiot.It is always good to get a fresh set of eyes. Link to comment Share on other sites More sharing options...
Synook Posted December 2, 2007 Share Posted December 2, 2007 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.