gpt4 book ai didi

javascript - 在 jQuery AJAX 中,为什么 $(selector).post() 和 $.get()

转载 作者:太空宇宙 更新时间:2023-11-04 15:47:51 26 4
gpt4 key购买 nike

在w3school上,我发现AJAX postget的定义是不同的。

帖子:

$(selector).post(URL,data,function(data,status,xhr),dataType)

获取

$.get(URL,data,function(data,status,xhr),dataType)

为什么带有选择器post方法和get方法没有?

最佳答案

我会根据我的评论做出回答,供其他登陆此处的人使用:

实际上,w3schools页面找到了here (我认为这就是您引用的页面)在其示例中指出使用 $.post(...) 是完全有效的。我认为这只是一个错字,不需要选择器。

在此 w3schools 网站上 here他们也使用正确的 post 语法。

请记住,仅仅因为它是像 stackoverflow 或 w3schools 这样广为人知的网站,就不需要它们每次都是正确的。更糟糕的是,几乎每次都亲自检查一下会更好:)

关于javascript - 在 jQuery AJAX 中,为什么 $(selector).post() 和 $.get(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43406267/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com