JQuery reload div content (dynamically rendered)

I have a div generated by html via Expression Engine. I am using ajax submit:

$('#login-form').ajaxForm({ // success identifies the function to invoke when the server response // has been received; here we apply a fade-in effect to the new content success: function() { $("#panel").RELOAD!!();//Just refresh this div! } }); 

I just want the #panel div to reload / refresh.

+4
source share
3 answers

I assume you are looking for something like this:

 $('#login-form').ajaxForm({ success: function( data) { $("#panel").html( data);//Will insert new content inside div element. } }); 

FIX:

 $('#login-form').ajaxForm({ target: '#panel', //Will update the "#panel" success: function( data) { alert( "Success"); } }); 
+4
source

Almost any of the methods listed in the jQuery "manipulation" section will do what you want: http://docs.jquery.com/Manipulation

+1
source

And for your pretty fading in

 success : function(data) { $("#panel").hide().html(data).fadeIn('fast'); } 
0
source

All Articles