jquery ajax load certain div

后端 未结 3 648
耶瑟儿~
耶瑟儿~ 2020-12-03 05:52

my question is very simple how can I retrieve certain div with jquery ajax comand

$.ajax({
      url: \"test.html\",
      success: function(){
           $         


        
3条回答
  •  隐瞒了意图╮
    2020-12-03 06:16

    If the div is part of the AJAX response:

    $.ajax({
        url: 'test.html',
        dataType: 'html',
        success: function(html) {
            var div = $('#sourceDiv', $(html)).addClass('done');
            $('#targetDiv').html(div);
        }
    });
    

提交回复
热议问题