27.10.2015 Views

AJAX and PHP

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

}<br />

throw(response.length == 0 ? "Server error" : response);<br />

// obtain a reference to the element on the page<br />

myDiv = document.getElementById("myDivElement");<br />

// display the HTML output<br />

myDiv.innerHTML += "New r<strong>and</strong>om number retrieved from server: "<br />

+ response + "";<br />

// increase requests count<br />

requestsCounter++;<br />

// reinitiate sequences<br />

setTimeout("process();", updateInterval * 1000);<br />

Chapter 3<br />

4. In the same folder, create smartproxyping.php:<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!