2012-03-31 82 views

回答

2

傳遞參數與urlfiles與身體:

$.ajax({ 
    url: 'someurl' + '?action=delete', 
    type: 'POST', 
    data: requestbodyhere, 
    success: function(responseData){ 
    } 
}); 
1

你想做一個POST?你可以做的是使用Ajax:

jQuery.ajax({ 
    type: 'POST', 
    url: url, 
    data: { 
    file1:'file1', 
    flie2:'file2' 
    }, 
    success: function(response) { 
    //in response you have the answer from the server as a string 
    } 
}); 
+0

這是不對的,你可以通過URL傳遞參數來說,不論是POST或GET! – Engineer 2012-03-31 09:44:15

+0

你是什麼意思?我忘了添加?action = delete,但我很確定MyWaitJSON可以自己弄清楚這個:) – haltabush 2012-03-31 09:47:56

+0

你是怎樣的聰明人?你已經編輯了你錯誤的答案! – Engineer 2012-03-31 09:49:54

相關問題