![](/img/trans.png)
[英]Ajax jQuery picture upload - newbie question whats the best way to handle this?
[英]Best way to handle serverside validations using jquery ajax
$('form[id^=comment_add]').live("submit",function()
{
var id= this.id.replace(/[^\d]+/g,'');
$.post($(this).attr('action'), $("#comment_add"+id).serialize(), function(data)
{
/*do something*/
})
.error(function(jqXHR, textStatus, errorThrown)
{
displayError(errorThrown, id);
});
reloaded();
return false;
});
目前,我正在使用包含json字符串的響應引發HTTP錯誤。 然后解析json字符串並顯示錯誤。 這是一個好方法還是有更好的方法? 或建議使用哪種方式顯示服務器端驗證
是的,這是個好主意。 出現錯誤時,即使StackOverflow也會引發不同的錯誤代碼。 使用您正在使用的這個
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.