Navigation Menu
Alphabetical Listing
Site Contents

Site FAQ
About JSS
JavaScript Forum
JavaScript Tutorial
Friends of JSS

Link to Us
JavaScript Help
Contribute a script
Technology Jobs

Become a Partner

Internet.commerce

Be a Commerce Partner














Internet.com

IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

Developer Channel

FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

Great Sites

DocJavaScript.com
dhtml.com
The Freebie Directory
TheFreeSite.com

Browse Doc JS's Tips!


Hiermenus Central


Promotions

Free Announcements


Social Bookmark

General

Many browsers allow the XMLHTTPRequest object to be created directly. One method is to use this snippet. It tries all methods of creating the object until it discovers one that works.

Notes

Microsoft's Internet Explorer uses ActiveX to create the XMLHTTPRequest object, whereas other borwsers — notable the Mozilla/Firefox range — allow the object to be created directly.

There are several ways of tackling this issue, some using browser detection routines (or tools such as BrowserHawk), others taking an approach similar to the following code, which tries all methods of creating the object until it discovers one that works.

See also the basic description of the XMLHTTPRequest object here and a more detailed discussion here.

Source Code

Paste this source code into the designated areas.

Snippet

Paste this code into your script.


User Comments

Add a comment, suggestion, or correction
[For questions about usage, consult the Notes tab above or visit the JavaScript forum. Do not include more than two (2) lines of code in your comments. If you have suggestions or corrections, you can submit them to us.]

    
   
       
[optional]
 
[optional]

   

Comments feed Comment Feed RSS 2.0

2. From: Frank G Buck
the tab navigation bar
10/24/2007 10:22:32

the tab navigation bar at the top of this message. Is there a Javascript to write this or is it AJAX.

3. From: Lee (Admin)
10/26/2007 13:40:42

You can find it here

4. From: santosh
10/12/2007 04:02:57

this script does not work
plz! help me

Thank you

5. From: Lee (Admin)
11/07/2007 15:32:03

You will need to submit your question to the JavaScript Forum for further help.

1. From: Biswajit
03/22/2007 02:17:14

I am not being able to create XMLHTTPRequest
object using your code

please Help me.

Thanks in Advance



Do you write JavaScripts?
If you do, why not submit them to us?
We'll give you credit and a link back to your Web site.