Ajax Hacks: Tips & Tools for Creating Responsive Web Sites
| At the center of many of the hacks in this book is the XMLHttpRequest object, which allows JavaScript to fetch bits of server data while the user is happily playing with the rest of your application. This object has its own API, which we will summarize in this introduction. "Detect Browser Compatibility with the Request Object" [Hack #1] covers setting up the request object in JavaScript. Once the object is initialized, it has several methods and properties that you can use in your own hacks.
The following list shows the properties supported by the request objects defined by most of the major browsers, such as Internet Explorer 5.0 and later, Safari 1.3 and 2.0, Netscape 7, and Opera's latest releases (such as Opera 8.5). Mozilla Firefox's request object has additional properties and methods not shared by the request objects of other major browsers,[2] but it also supports all of the following: [2] The Mozilla Firefox XMLHttpRequest object has onload, onprogress, and onerror properties that are event listener types. Firefox has also defined addEventListener( ), dispatchEvent( ), overrideMimeType( ), and removeEventListener( ) methods. See http://www.xulplanet.com/references/objref/XMLHttpRequest.html for more details on these Firefox request object members.
The methods supported include:
|
Категории