When do you use JQuery's Ajax method load and get? They seem to achieve the same things? Anybody knows? Thank you very much.
I'm not asking the difference between get and post methods. I'm asking Jquery get vs Jquery load methods.
When do you use JQuery's Ajax method load and get? They seem to achieve the same things? Anybody knows? Thank you very much.
I'm not asking the difference between get and post methods. I'm asking Jquery get vs Jquery load methods.
To start with load uses get internally. When your server returns plain html and you want to set that html completely to an element, you can use load. Otherwise get or post
This method is the simplest way to fetch data from the server. It is roughly equivalent to $.get(url, data, success) except that it is a method rather than global function and it has an implicit callback function. When a successful response is detected (i.e. when textStatus is "success" or "notmodified"), .load() sets the HTML contents of the matched element to the returned data.