Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
liam johnshon
Courses Plus Student 904 Pointswhen to use ?
i m little bit confuse in $("#id").load(); & $.get() when to us both...!
1 Answer
Ryan Chatterton
5,914 PointsWell .load() can be used for POST/GET as well. Where .get() is used in GET.
.load() can also allow you to specify where you want the document inserted.
$('#id').load("myAjax/test.html", "#container");
So .load() really is only useful when the call only will result in HTML.
These are just wrappers for $.ajax() so a lot of times you will see just the $.ajax() being defined.