0
我用Rails 2.3.8,并有一个jQuery AJAX的使用形式发布使用:Rails的解析jQuery的报价错误
jQuery.fn.submitWithAjax = function() {
this.submit(function() {
jQuery.post(this.action, $j(this).serialize(), null, "script");
return false;
});
return this;
};
如果我尝试后,在有引号文本就如
1
"2"
3
只有什么是引号内收到的参数:
Parameters: {"contact_id"=>"1", "action"=>"create", "note"=>{"note"=>"2"}, "controller"=>"notes"}
任何想法,为什么?
jQuery.serialize在浏览器内返回音符%5Bnote%5D = 1%0A%222%22%0A3
更新:这里的形式
<form action="/contacts/1/notes" class="note_form" id="note_create_form" method="post">
<p><textarea class="autogrow" cols="40" id="note_note" name="note[note]" rows="20"></textarea></p>
<p><input class="submitbut" name="commit" type="submit" value="Add this Note" /> </p>
</form>
你可以发布问题字段的html吗? – jdeseno 2010-08-06 16:16:56
我已经用代码更新了问题。它由Rails表单助手生成。 – 2010-08-09 08:48:58