Bug Tracker

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#14148 closed bug (notabug)

jQuery.post() - "%5Bobject%20Object%5D"

Reported by: [email protected] Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.10.2
Keywords: Cc:
Blocked by: Blocking:


The jquery post method can't create the URL, all URLs are set to %5Bobject%20Object%5D.

If I change my code to $.ajax({method:"post"}), then it works fine.

Change History (4)

comment:1 Changed 9 years ago by anonymous

Check this out with console, this is the bad example: http://jsfiddle.net/7r3T4/

This is the working version: http://jsfiddle.net/Zg5ZB/

comment:2 Changed 9 years ago by dmethvin

Resolution: notabug
Status: newclosed

Indeed, that is a bad example. Don't pass an object to $.post() since it expects a string that represents a URL. http://api.jquery.com/jQuery.post/

comment:3 Changed 9 years ago by [email protected]

On the documentation page, you can read this: "This is a shorthand Ajax function, which is equivalent to" and a code below.

So if it is a shorthand code, it is expected to work the same as the jQuery.ajax with the same functionality.

Can you update the post method in the future to work like jQuery.ajax and to be fully compatible? That would be really nice.

comment:4 Changed 9 years ago by dmethvin

On the documentation page, it says what the arguments are. Just read the documentation and follow it.

Note: See TracTickets for help on using tickets.