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 . Link to comment https://forums.phpfreaks.com/topic/4678-php-query/ 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? Link to comment https://forums.phpfreaks.com/topic/4678-php-query/#findComment-16379 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 ? Link to comment https://forums.phpfreaks.com/topic/4678-php-query/#findComment-25491 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] Link to comment https://forums.phpfreaks.com/topic/4678-php-query/#findComment-25591 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. Link to comment https://forums.phpfreaks.com/topic/4678-php-query/#findComment-25668 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.