jQuery reload div's content (dynamically rendered)

前端 未结 3 389
走了就别回头了
走了就别回头了 2020-12-11 08:13

I have a div that is generated html via Expression Engine. I\'m using ajax submit:

$(\'#login-form\').ajaxForm({  
    // success identifies the function to         


        
相关标签:
3条回答
  • 2020-12-11 08:24

    And for your pretty fade in

    success : function(data) {
       $("#panel").hide().html(data).fadeIn('fast');
    } 
    
    0 讨论(0)
  • 2020-12-11 08:35

    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");
        } 
    });
    
    0 讨论(0)
  • 2020-12-11 08:35

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

    0 讨论(0)
提交回复
热议问题