jQuery partial page refresh after form submit

Posted by heeboir on Stack Overflow See other posts from Stack Overflow or by heeboir
Published on 2010-03-18T00:42:04Z Indexed on 2010/03/18 1:01 UTC
Read the original article Hit count: 701

Filed under:
|
|

When using jQuery to submit a form is it possible to place the resulting page (after the submit) inside another HTML element?

I'll try to make this clearer. Up to now I've been using Callback methods that among others do a

document.forms['form'].submit();

whenever a form has been updated with new information and needs to be refreshed. However, this results in a full page refresh. I'm implementing Partial Page Refresh using jQuery and thought of using something like

var newContent = jQuery('#form').submit();
jQuery('#div').load(newContent);

However, that does not seem to work as the page is still fully refreshed. The content is correct, however the behaviour seems to be exactly the same as before - so I'm not really sure if what I want is actually possible with jQuery. Any hints and pointers would be helpful.

Thanks.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about renderpartial