如何使用jQuery发送PUT/DELETE请求?

26 浏览
0 Comments

如何使用jQuery发送PUT/DELETE请求?

GET:使用$.get(..)方法。

POST:使用$.post()..方法。

PUT/DELETE如何处理?

admin 更改状态以发布 2023年5月19日
0
0 Comments

$.ajax 将起作用。

$.ajax({
   url: 'script.php',
   type: 'PUT',
   success: function(response) {
     //...
   }
});

0
0 Comments

你可以使用ajax方法:\n

$.ajax({
    url: '/script.cgi',
    type: 'DELETE',
    success: function(result) {
        // Do something with the result
    }
});

0