-5

I have a small form I'd like to validate with AJAX. (I'm using jQuery)

I'd like to pass the data entered in the inputs by the user (POST method) and some other data that is typically available in my controller/view.

How can I do that?

Thanks

4

3 回答 3

2

GET 数据进入 URL

 /controller/action?name=will&last_name=smith

POST 数据在请求正文中以多种方式传输,包括 form-data、xml、json 等

也许您应该尝试使用您的请求正文数据发布第一个 url

于 2013-03-17T21:56:48.363 回答
1

只需在 URL 中包含 GET-data,例如 http://www.example.com?param=value

其余使用 POST

于 2013-03-17T21:57:28.057 回答
0

您可以将要发送的数据包含在隐藏的表单字段中,在控制器上处理发布请求,然后重定向以获取

于 2013-03-17T22:06:25.917 回答