jQuery.load VS. jQuery.ajax
I hope this is the right forum, newb here.
Anyways, I was wondering what practice is better and faster for loading data onto a page.
- $(document).ready(function() {
- $("#page").load("something.html");
- });
- OR -
- $(document).ready(function() {
- $.ajax({
- url: "something.html",
- cache: false,
- success: function(response) {
- $("#page").html(response);
- }
- });
- });
Is there significant ups/downs to using either one of these? Is one better than the other?
Thanks!
- Sam.