adspace


How do we get the xmlhttprequest object in ajax?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Is json is a programming language?

1008


Is ajax a framework?

968