开发者

What happens if I call jQuery.post() with an empty url?

开发者 https://www.devze.com 2023-04-01 06:09 出处:网络
If I submit a form with an empty action field, it su开发者_如何学JAVAbmits to the current page--is this the case with ajax requests?I fell over this question when wondering the same about the $.ajax m

If I submit a form with an empty action field, it su开发者_如何学JAVAbmits to the current page--is this the case with ajax requests?


I fell over this question when wondering the same about the $.ajax method. It turns out that it works in chrome, but not IE if you have a blank URL.


That's correct, it submits to the current page.

Reference, jQuery documentation:

url (String)
Default: The current page
A string containing the URL to which the request is sent.

Source


This parameter is not marked as Optional. Some errors are possible.

http://docs.jquery.com/Post

0

精彩评论

暂无评论...
验证码 换一张
取 消