How do we get the xmlhttprequest object in ajax?



How do we get the xmlhttprequest object in ajax?..

Answer / Amit Ghildiyal

To get the XMLHttpRequest object, you can use either the native JavaScript constructor or the browser-specific window property, depending on your needs. Here's an example of both methods:nn```javascriptn// Using the native constructornconst xhr = new XMLHttpRequest();nn// Using the window property (for IE)nconst xhr = new ActiveXObject('Microsoft.XMLHTTP');n```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More AJAX Interview Questions

Is the server or the client in control?

1 Answers  


Can I use ajax with seam?

1 Answers  


Which are the two methods used for cross domain Ajax calls?

1 Answers  


Did adaptive path invent ajax?

1 Answers  


What are the new features of asp.net ajax 4.0? : asp.net ajax

1 Answers  


Is it true that the ajax application are much better than the classical internet applications?

1 Answers  


How many types of ready states in Ajax?

1 Answers  


What is Script Manager?

1 Answers  


Should I use an http get or post for my ajax calls?

1 Answers  


What are the technologies used by ajax?

1 Answers  


Does ajax have the same meaning as xmlhttprequest?

1 Answers  


What is xmlhttprequest object in ajax?

1 Answers  


Categories