Top 100+ XML HTTP Request (XHR) Interview Questions And Answers
Question 1. Explain Getallresponseheaders ()?
Answer :
getAllResponseHeaders ():- Returns a set of HTTP headers as string. If you want a particular header value, you could use getResponseHeader ("header name")
Question 2. Explain Onreadystatechange?
Answer :
Onreadystatechange: - This is a event handler, which fires at every state trade.
Java Script Interview Questions
Question three. What Is Response?
Answer :
Response: - Returns the reaction as XML. Therefore, this offers us DOM object model, which could then be traversed.
Question 4. What Is Setrequestheader ("label"," Value")?
Answer :
SetRequestHeader ("label"," cost"):- Sets label price pair for a HTTP header.
Java Script Tutorial
Question 5. What Is Response Text?
Answer :
Response Text: - Returns the reaction in simple string.
AJAX Interview Questions
Question 6. How Do We Do Asynchronous Processing Using Ajax?
Answer :
xmlHttpObj.Onreadystatechange = function1();
Above is the code snippet, if you want to assist us to do asynchronous processing. So function1 () will be known as when the XMLHTTP request item goes to on ready state exchange.
Question 7. What Is Send(content)?
Answer :
The send(content) method transmits the request, optionally with postable string or the data of DOM object.
AJAX Tutorial JSP Interview Questions
Question eight. What Is Open(arg, Arg,arg,arg,arg) Function?
Answer :
The open("technique", "URL"[, asyncFlag[, "userName"[, "password"]]]) is used to assign the vacation spot URL, method, and different non-compulsory attributes of a request.
Question 9. What Is Getresponseheader("headerlabel")?
Answer :
The getResponseHeader("headerLabel") method is used to go back the string value of a single header label.
Oracle 11g Interview Questions
Question 10. Explain Abort() Function?
Answer :
The abort() is used to stop the contemporary request.
JSP Tutorial
Question eleven. What Is Statustext?
Answer :
The 'statusText' property is used for string messages that accompany the status code.
Hibernate Interview Questions
Question 12. What Is Responsexml?
Answer :
The 'responseXML' property is DOM-compatible file object of records again from server procedure.
Java Script Interview Questions
Question 13. How Can We Consume Data Directly In Web Services?
Answer :
We can devour records directly the usage of 'Sys.Data' controls. We recognise this is a totally brief solution for such an critical question, however the bandwidth of this book does now not permit for the same. We propose the readers to exercise a few sample the use of the 'Sys.Data' manage.
Note: - We have left essential controls like Data controls, Login controls, Web component controls, cell controls and profilescriptservice control. These controls will be rarely asked in the course of interviews, however from mission components they may be very critical.
Oracle 11g Tutorial
Question 14. What Is The Fundamental Behind Ajax?
Answer :
XmlHttpRequest is the fundamental behind Ajax. This permits the browser to communicate to a returned give up server asynchronously.XmlHttpRequest object lets in the browser to communicate with server without posting the entire web page and only sending the essential records asynchronously.
Question 15. What Is Cors? How Does It Work?
Answer :
Cross-foundation aid sharing (CORS) is a mechanism that permits many sources (e.G., fonts, JavaScript, and so on.) on an internet web page to be asked from some other area outdoor the area from which the resource originated. It's a mechanism supported in HTML5 that manages XMLHttpRequest get right of entry to to a site extraordinary.
CORS adds new HTTP headers that provide get right of entry to to accepted starting place domains. For HTTP methods aside from GET (or POST with certain MIME types), the specification mandates that browsers first use an HTTP OPTIONS request header to solicit a listing of supported (and available) strategies from the server. The real request can then be submitted. Servers also can notify clients whether or not "credentials" (along with Cookies and HTTP Authentication records) must be despatched with requests.
Javascript Advanced Interview Questions
Question sixteen. Explain What Is Json?
Answer :
JSON is a completely light-weight data layout primarily based on a subset of the JavaScript syntax, namely array and object literals. JSON allows speaking with server in a general way. JSON is used as verbal exchange notation instead of XML.
Hide Copy Code
var oBike =
"shade" : "Green",
"Speed": 2 hundred,
;
alert(oBike.Coloration); //outputs "Green"
alert(oBike.Speed); //outputs two hundred
The above code creates an javascript item motorcycle with two homes Color and Speed.
Hibernate Tutorial
Question 17. How Do I Get The Xmlhttprequest Object?
Answer :
Depending upon the browser.
If (window.ActiveXObject)
// Internet Explorer
http_request = new ActiveXObject("Microsoft.XMLHTTP");
else if...
If(window.XMLHttpRequest)
xmlhttpobj=new XMLHttpRequest();
go back xmlhttpobj;
else
attempt
xmlhttpobj=new ActiveXObject("Microsoft.XMLHTTP");
catch(e)
xmlhttpobj=new ActiveXObject("Msxml2.XMLHTTP");
HTTP Interview Questions
Question 18. What Is Ready State?
Answer :
Ready State: - Returns the current state of the object.
0 = uninitialized
1 = loading
2 = loaded
three = interactive
four = entire
AJAX Interview Questions
Question 19. Explain Open ("method", "url", "async", "uname", "pswd")?
Answer :
Open ("technique", "URL", "async", "uname", "pswd"):- This approach takes a URL and other values wanted for a request. You also can specify how the request is sent by way of GET, POST, or PUT. One of the vital values is how this request can be sent asynchronously or synchronously. True method that processing is carried after the ship () technique, with out looking ahead to a response. False way that processing is waits for a response before persevering with.
Javascript Advanced Tutorial
Question 20. Can You Explain Scriptmanager Control In Ajax?
Answer :
Scriptmanager control is the important coronary heart of Ajax. They manage all of the Ajax related items at the web page.
Some of the core goals of scriptmanager manage are as follows:-
Helps load core Ajax associated script and library.
Provides get right of entry to to internet services.
ASP.NET authentication, function and profile services are loaded with the aid of scriptmanager manage.
Provided registration of server controls and behaviors.
Enable full or partial rendering of an internet web page.
Provide localization capabilities.
In short , any Ajax permit web page need to have this control.
Java XML Interview Questions
Question 21. Explain The Purpose Of Each Of The Http Request Types When Used With A Restful Web Service?
Answer :
The cause of every of the HTTP request types whilst used with a RESTful internet provider is as follows:
GET: Retrieves records from the server (must handiest retrieve statistics and ought to have no other effect).
POST: Sends facts to the server for a new entity. It is frequently used when uploading a report or submitting a completed internet form.
PUT: Similar to POST, but used to update an present entity.
PATCH: Similar to PUT, however used to replace only certain fields within an existing entity.
DELETE: Removes information from the server.
TRACE: Provides a way to check what a device alongside the community course gets when a request is made. As such, it actually returns what was despatched.
OPTIONS: Allows a patron to request records about the request methods supported with the aid of a provider. The relevant response header is Allow and it clearly lists the supported techniques. (It can also be used to request statistics approximately the request strategies supported for the server wherein the carrier resides through using a * wildcard in the URI.)
HEAD: Same because the GET approach for a aid, but returns only the reaction headers (i.E., and not using a entity-body).
CONNECT: Primarily used to establish a network connection to a useful resource (usually through some proxy that can be requested to ahead an HTTP request as TCP and keep the relationship). Once set up, the reaction sends a 200 fame code and a "Connection Established" message.
Question 22. How Do We Pass Parameters To The Server?
Answer :
Below are the two approaches of passing statistics to server. The first one shows by means of the use of GET and the second by way of POST.
XmlHttpObj.Open("GET","http://" + vicinity.Host +
"/XmlHttpExample1/WebForm1.Aspx?Cost=123", genuine);
xmlHttpObj.Open("POST","http://" + vicinity.Host +
"/XmlHttpExample1/WebForm1.Aspx?Cost=123", genuine);
HTTP Tutorial
Question 23. Explain Setrequestheader("label", "value")?
Answer :
The setRequestHeader("label", "value") technique is used to assign a label/fee pair to the header to be despatched with a request.
Advanced C# Interview Questions
Question 24. What Is Status?
Answer :
The 'reputation' assets is for returning numeric codes from the server like error codes, etc.
JSP Interview Questions
Question 25. What Is Getallresponseheaders()?
Answer :
The getAllResponseHeaders() approach is used to return the total set of headers as a string.
Java XML Tutorial
Question 26. What Is Readystate?
Answer :
The 'readyState' property is an object popularity integer. It makes use of the integers zero to four for uninitialized, loading, loaded, interactive and entire states.
WebLogic Administration Interview Questions
Question 27. What Is Onreadystatechange?
Answer :
The 'onreadystatechange' belongings fires at each state alternate event.
Oracle 11g Interview Questions
Question 28. What Is Responsetext?
Answer :
The 'responseText' belongings is a string model of records again from server system.
EbXML Tutorial

