Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JQuery .get vs load() performance question

Tags:

jquery

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?

like image 405
dvancouver Avatar asked Feb 05 '09 00:02

dvancouver


1 Answers

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()

like image 141
Cody Caughlan Avatar answered Sep 22 '22 01:09

Cody Caughlan