2011-10-22 49 views

回答

3

除了jQuery.post的建议,你也可以使用jQuery.ajax设置为 'POST' 类型的属性,例如:

$.ajax({ 
    url: '/your/service/url', 
    type: 'GET', 
    dataType: 'json', 
    data: 'extraparam=45869159&another=32', 
    success: function (data) { 
     //handle the returned data 
    } 
}); 

类型属性适用GETPOSTPUTDELETE

尽管存在以下情况注意:其他HTTP请求方法(例如PUT和DELETE)也可以在此处使用,但它们不受所有浏览器支持。

我还未找到一个不支持他们的浏览器。 IE 6也支持它们。