lukeUrtnoedki Posted November 20, 2016 Share Posted November 20, 2016 (edited) I have a pretty simple form php_class.teamluke.net/ajax/send.php and am trying to use ajax to link to it, so it can be read by a php page, heres the script <script> function showCar(str) { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("myForm")..style.display = none; document.getElementById("result").style.display = block; document.getElementById("result").innerHTML = this.responseText; } }; xhttp.open("GET", "showCar.php?id="+str, true); xhttp.send(); } </script> but the php page works... php_class.teamluke.net/ajax/showCar.php?id=1 Edited November 20, 2016 by requinix I still don't know why ipb doesn't like that domain name Quote Link to comment https://forums.phpfreaks.com/topic/302573-link-to-a-php-page/ Share on other sites More sharing options...
requinix Posted November 20, 2016 Share Posted November 20, 2016 Well, tthere's a typpo on that oone line there thhat will prevent any Javvascript from executinng at alll... 1 Quote Link to comment https://forums.phpfreaks.com/topic/302573-link-to-a-php-page/#findComment-1539484 Share on other sites More sharing options...
Jacques1 Posted November 20, 2016 Share Posted November 20, 2016 You'll also want to learn how to use the debug tools of your browser (especially the JavaScript console) so that you can find and fix trivial problems like this yourself. Good IDEs like Netbeans or Eclipse can actually check your code as you write it. Saves a lot of time. 1 Quote Link to comment https://forums.phpfreaks.com/topic/302573-link-to-a-php-page/#findComment-1539485 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.