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

JavaScript AJAX Basics (retiring) jQuery and AJAX The jQuery AJAX Method

Bruno Dias
Bruno Dias
10,554 Points

type: "POST" or method: "POST"?

In the video, Dave McFarland mentions method "POST" but he types type: "POST" instead.

Which one is correct?

2 Answers

Steven Parker
Steven Parker
229,759 Points

The JQuery documentation explains that "method" was added in JQuery version 1.9.0. Prior to that, it was called "type", and "type" is still an alias for "method".

It could just be a habit Dave developed from using JQuery starting before version 1.9.0.

:point_right: Best practice for now on would be to use "method".

Bruno Dias
Bruno Dias
10,554 Points

Hey Steven, thanks for clarifying.

Tan Guven
Tan Guven
3,379 Points

Is there any different library just for simplify ajax? Because jquery is quiet big for just ajax.