tags:

views:

721

answers:

2

Is it better to use

$.get("http://www.example.com/mydirectory", function(data) {
        $(".someclass").html(data);
});

or

$('.tripPlannerBottom').load("http://www.example.com/mydirectory");

any speed or performance benefits?

+5  A: 

I have no benchmark data to back my claim up, but by looking at the source, $.get + html() and .load() are basically the same. .load() is a convenience wrapper around .get() + html()

Cody Caughlan
So as its a coding benefit :)
Ricardo Vega
+3  A: 

.load, .get & .post are wrappers around the .ajax method. There is no performance boost apart from few chars you save in typing without having to create the settings if using the .ajax method.

redsquare