How do I filter the returned data from jQuery.ajax()?

前端 未结 5 1661
猫巷女王i
猫巷女王i 2020-11-30 01:48

When using the jQuery.ajax() method, I am struggling to filter the data that is returned to get exactly what I need. I know this is easy using .load()

5条回答
  •  粉色の甜心
    2020-11-30 02:40

    This is how I was able to get it working thanks to @Matt

    $.ajax({
        type: "GET",
        url: url,
        dataType: 'html',
        success: function(data) {
            $('#foo').html(
                $('
    ').html(data).find('#foo').html() ); } });

提交回复
热议问题