我有一个窗体。我试图通过AJAX GET请求来验证它。窗体序列化问题
所以我想发送GET请求数据中的字段值。
$('#uxMyForm').serialize();
它返回的东西难以辨认的问题。我之前使用过序列化。这完全是b。。
连载的返回值是
actionsign_upcontrollersitedataauthenticity_token=oRKIDOlPRqfnRehedcRRD7WXt6%2FQ0zLeQqwIahJZJfE%3D&customer%5BuxName%5D=&customer%5BuxEmail%5D=&customer%5BuxResidentialPhone%5D=&customer%5BuxMobilePhone%5D=&customer%5BuxDateOfBirth%5D=&customer%5BuxAddress%5D=&customer%5BuxResidentialStatus%5D=
我不知道怎么用这个。
感谢
更新:
我的问题是我如何处理这样的要求?喜欢这个?
puts params[:data][:customer][:uxName]
我的GET请求触发看起来像这样
$.get('/site/sign_up',{data : $('#uxMyForm').serialize() }, function(data){
alert(data);
});
以上的jQuery线产生的请求..在操作方法我这样做
render :text => params
当我观察是什么发送到GET,在萤火虫PARAMS
**data** authenticity_token=oRKIDOlPRqfnRehedcRRD7WXt6%2FQ0zLeQqwIahJZJfE%3D&direct_customer%5BuxName%5D=&direct_customer%5BuxEmail%5D=&direct_customer%5BuxResidentialPhone%5D=&direct_customer%5BuxMobilePhone%5D=&direct_customer%5BuxDateOfBirth%5D=&direct_customer%5BuxAddress%5D=&direct_customer%5BuxResidentialStatus%5D=
,我在警告打印则返回值
actionsign_upcontrollersitedataauthenticity_token=oRKIDOlPRqfnRehedcRRD7WXt6%2FQ0zLeQqwIahJZJfE%3D&direct_customer%5BuxName%5D=&direct_customer%5BuxEmail%5D=&direct_customer%5BuxResidentialPhone%5D=&direct_customer%5BuxMobilePhone%5D=&direct_customer%5BuxDateOfBirth%5D=&direct_customer%5BuxAddress%5D=&direct_customer%5BuxResidentialStatus%5D=
它格式化它在一个'名1 =值1&名2 = value2'格式...一样在浏览器(GET请求)查询字符串,这是你'.serialize想要什么()',如果你发布你的提交代码,你会更容易看到你实际上在做什么。 – 2010-05-28 11:43:00
已更新..请建议 – ZX12R 2010-05-28 12:29:07