In jQuery .get() method loads data from the server by using the GET HTTP request. This method returns XMLHttpRequest object.
$.get( url, [data], [callback], [type] )
- url : String containing the URL at which request is to be sent
- data : This is an optional parameter that represents key/value pairs that will be sent to the server.
- callback: This optional parameter represents the function which is to be executed whenever the data is loaded successfully.
- type : This parameter represents type of data to be returned to the callback function i.e “xml”, “script”, “json”, “html”, “html”, “jsonp”, or “text”.
Before clicking on the button:
After clicking on the button:
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.