clonetrooper9494 Posted February 4, 2008 Share Posted February 4, 2008 I copied it right from the AJAX page, and it just doesn't work... what am I doing wrong?http://clone-drone.net/axaj_test.html <html><body><script type="text/javascript">function ajaxFunction(){var xmlHttp;try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); }catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return false; } } } xmlHttp.onreadystatechange=function() { if(xmlHttp.readyState==4) { document.myForm.time.value=xmlHttp.responseText; } } xmlHttp.open("GET","http://clone-drone.net/time.php",true);//my host doesn't support ASP... so I used PHP xmlHttp.send(null); }</script><form name="myForm">Name: <input type="text"onkeyup="ajaxFunction();" name="username" />Time: <input type="text" name="time" /></form></body></html> http://clone-drone.net/time.php <?phpecho "testing";return "123";?> ASP doesn't work with my host... so I used PHP... what am I doing wrong? Link to comment Share on other sites More sharing options...
Ingolme Posted February 4, 2008 Share Posted February 4, 2008 I go to http://clone-drone.net/axaj_test.html and all I see is "URL: http://clone-drone.net(none)" in the source code. Link to comment Share on other sites More sharing options...
clonetrooper9494 Posted February 4, 2008 Author Share Posted February 4, 2008 Oops... go here:http://clone-drone.net/axaj_test2.htmlSorry about that. Link to comment Share on other sites More sharing options...
Ingolme Posted February 4, 2008 Share Posted February 4, 2008 It's working OK in my browsers.Your "return 123;" line isn't necessary. AJAX receives any text that you would see by opening the PHP file directly.Just use echo to display the information you want. Link to comment Share on other sites More sharing options...
clonetrooper9494 Posted February 4, 2008 Author Share Posted February 4, 2008 huh. it wasn't before... probably because I was using camino at my school computer lab... well, if I have any trouble, I will post. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.