-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

The JavaScript JSON Cookbook
By :

All modern web browsers provide an XMLHttpRequest
class you can instantiate in your code, which you can use to issue asynchronous calls to obtain content over HTTP. You'll create one or more of these in your client-side JavaScript using the new
operator.
You'll want to create an instance of this class early on in your JavaScript after the page loads, as shown in the following code:
function doAjax() { var xmlhttp; if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } }
The preceding code tests the root-level JavaScript window
object for the XMLHttpRequest
class, and if the browser defines the class, creates an instance of the class for us to use in the making of asynchronous requests.
If you're working with a very old version of Internet Explorer, you may need to use a Microsoft.XMLHTTP
ActiveX object. In which case, the test for window...
Change the font size
Change margin width
Change background colour