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
Blaž Pezdir
11,049 PointsURL attribute in $.ajax()
In the video the author writes the AJAX call like this:
$.ajax(url, settings);
"settings" attribute is an JS object.
As I go thru the documentation on JQuery and W3, I see that on there, the URL goes inside the "settings" object. May I ask what is the purpose of the author doing it differently, writting it outside the settings object?
Blaž Pezdir
11,049 PointsBlaž Pezdir
11,049 PointsNever mind. I now see both are correct.
jQuery.ajax( url [, settings ] ) --> Came with version 1.5
Before that the only way was like this --> jQuery.ajax( [settings ] )