开发者

Using jQuery mobile to update DOM after form POST

jQuery Mobile's form submission is handled automatically with AJAX. However it isn't clear how to handle the Response. I want to update the page with some JSON coming back from the server. Do I need to disable jQuery Mobile's 开发者_Python百科form AJAX?


I recommend reading about progressive enhancement which is a main idea with which jQuery Mobile's architecture was created. The answer from the server should be a new HTML document with correct content so that it works with no-JS browsers as well. jQuery Mobile is there to make it come in via AJAX.

If you want to break this rule you have to post the data yourself like you always did with jQuery's .post()

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜