PHP Development of Ajax One
Ajax this east two days ago just contact, listen to others said very useful oh, feel the need to learn.
Here's an example of passing parameters to a PHP page using the Get method:
Test.html
<title></title>
Test.js
var xmlhttp;function Getxmlhttpobject () {if (window. XMLHttpRequest) {//code for ie7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest (); }else{//code for IE6, IE5 xmlhttp=new ActiveXObject (microsoft.xmlhttp); } return XMLHTTP;} -----------Ajax Method-----------//function Testcheck () {xmlhttp=getxmlhttpobject (); if (xmlhttp==null) {alert (' Your browser does not support ajax! '); Return } var url=http://localhost/phptest/index.php?isbn=110120;//this place must be noticed oh, at first I was in ' = ' preceded by a space, the result of PHP page can not get parameters, we must pay attention to some Oh Xmlhttp.open (get,url,true); xmlhttp.onreadystatechange=getokget;//send the event, the message is received after the call function Xmlhttp.send ();} function Getokget () {if (xmlhttp.readystate==1| | xmlhttp.readystate==2| | xmlhttp.readystate==3) {//local prompt: Load in} if (xmlhttp.readystate==4 && xmlhttp.status==200) {alert ( Xmlhttp.responsetext); Alert (' 123 '); Process return result}}
index.php
The other Test.js URL should be the path of your file, don't get it wrong oh, hey
Let's show you how it works!
http://www.bkjia.com/PHPjc/992671.html www.bkjia.com true http://www.bkjia.com/PHPjc/992671.html techarticle PHP Development Ajax an Ajax two days before the first contact, listen to others say very useful oh, feel the need to learn. The following is a get method to pass parameters to the PHP page for example ...