views:

18671

answers:

3

I have a div that is generated html via Expression Engine. I'm 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.

+1  A: 

I assume you looking for something like that:

$('#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");
    } 
});
Artem Barger
Expression Engine does an auto-return after submission. I can't tell if this is working...I think it is, but EE tries to reload the whole page for some reason...
Kevin Brown
Is this jquery 1.3 specific?
Kevin Brown
I've found it in plugin documentation and sample codes.
Artem Barger
+1  A: 

Pretty much any of the methods listed in jQuery's "manipulation" section are going to do what you want: http://docs.jquery.com/Manipulation

Gabriel Hurley
A: 

And for your pretty fade in

success : function(data) {
   $("#panel").hide().html(data).fadeIn('fast');
}
Paul Tarjan
This is a syntax question: Why do you have single quotes around 'fast' instead of double?
Kevin Brown
no reason. I sadly mix and match stupidly.
Paul Tarjan