newman Posted March 11, 2006 Share Posted March 11, 2006 hi all . how can i query my database without reloading the page . i read some tutorials about PHP and AJAX . but i didnot understand the solution . Quote Link to comment Share on other sites More sharing options...
Barand Posted March 11, 2006 Share Posted March 11, 2006 Does [a href=\"http://members.aol.com/barryaandrew/xmlhttp/article.html\" target=\"_blank\"]this[/a] help? Quote Link to comment Share on other sites More sharing options...
newman Posted April 10, 2006 Author Share Posted April 10, 2006 thank you so much for your useful tutorial , but when I use the JS code blow i get a javascript error : [b]unepected indetifier[/b][code]function handleMessages (url, resultID) { var obj; xmlhttp.open("GET", url, true); xmlhttp. { if (xmlhttp.readyState==4) { obj = document.getElementById(resultID); obj.innerHTML = xmlhttp.responseText; } } xmlhttp.send(); return 0;}[/code]what's the problem ? Quote Link to comment Share on other sites More sharing options...
Barand Posted April 10, 2006 Share Posted April 10, 2006 Is it because part of the code is missing?[code]function handleMessages (url, resultID) { var obj; xmlhttp.open("GET", url, true); xmlhttp.onreadystatechange=function() { // <-- misssing code if (xmlhttp.readyState==4) { obj = document.getElementById(resultID); obj.innerHTML = xmlhttp.responseText; } } xmlhttp.send(); return 0;}[/code] Quote Link to comment Share on other sites More sharing options...
newman Posted April 10, 2006 Author Share Posted April 10, 2006 thanks a million . it's functioning perfectly. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.