开发者

Way to grab specific container from Ajax jQuery Call

开发者 https://www.devze.com 2023-01-31 17:53 出处:网络
Is there a way to make an Ajax call with jQuery to call a specific page, grab only a specific container on the page that is being called, and inject the dat开发者_运维问答a from that container into a

Is there a way to make an Ajax call with jQuery to call a specific page, grab only a specific container on the page that is being called, and inject the dat开发者_运维问答a from that container into a new container? Does that make any sense?


It is possible. Something like:

jQuery.get('index.html', function (data) {
  $('.container').html($(data).find('.container'));
});

However, it seems a bit strange to do this. The standard is to use your application server to format the results (and only return the results that will be substituted.

0

精彩评论

暂无评论...
验证码 换一张
取 消