"Watch it!!"
+The words below will be replaced by "Hello World" which is pulled from the 'myfirstprogram.php' file via AJAX.
+AJAX DEMO
++
diff --git a/9781484217290.jpg b/9781484217290.jpg new file mode 100644 index 0000000..e634613 Binary files /dev/null and b/9781484217290.jpg differ diff --git a/Example Code Files/chapter1/p1helloworld.php b/Example Code Files/chapter1/p1helloworld.php new file mode 100644 index 0000000..6bee76b --- /dev/null +++ b/Example Code Files/chapter1/p1helloworld.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/Example Code Files/chapter2/e21Ajax_Example_JavaScript.js b/Example Code Files/chapter2/e21Ajax_Example_JavaScript.js new file mode 100644 index 0000000..5a0bbae --- /dev/null +++ b/Example Code Files/chapter2/e21Ajax_Example_JavaScript.js @@ -0,0 +1,46 @@ +function getXMLHttp() +{ +var xmlHttp; +try +{ +xmlHttp = new XMLHttpRequest(); +} +catch(e) +{ +//Internet Explorer is different than the others +try +{ +xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); +} +catch(e) +{ +try +{ +xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); +} +catch(e) +{ +alert("Old browser? Upgrade today so you can use AJAX!") +return false; +} +} +} +return xmlHttp; +} +function AjaxRequest() +{ +var xmlHttp = getXMLHttp(); +xmlHttp.onreadystatechange = function() +{ +if(xmlHttp.readyState == 4) +{ +HandleResponse(xmlHttp.responseText); +} +} +xmlHttp.open("GET", "myfirstprogram.php", true); +xmlHttp.send(null); +} +function HandleResponse(response) +{ +document.getElementById('AjaxResponse').innerHTML = response; +} \ No newline at end of file diff --git a/Example Code Files/chapter2/e22helloworldajax.html b/Example Code Files/chapter2/e22helloworldajax.html new file mode 100644 index 0000000..f7e8e9a --- /dev/null +++ b/Example Code Files/chapter2/e22helloworldajax.html @@ -0,0 +1,22 @@ + + +
The words below will be replaced by "Hello World" which is pulled from the 'myfirstprogram.php' file via AJAX.
+The words below will be replaced by "Hello World" which is pulled from the 'myfirstprogram.php' file via AJAX.
+