开发者

jQuery.get() div html data from external page

开发者 https://www.devze.com 2023-04-03 19:39 出处:网络
When we use jQuery load() we can define a DIV on the external page we want to load into our content. Is there a similar way to get the html data开发者_开发技巧 from a specific DIV from an external pa

When we use jQuery load() we can define a DIV on the external page we want to load into our content.

Is there a similar way to get the html data开发者_开发技巧 from a specific DIV from an external page? Something like this?

var url = someurl;
var div = specificdiv
    $.get(someurl+' '+specificdiv , function(data) {
        $('#target_div').html(data);
    });


$('#target').load('http://example.com/someurl.html #specificdiv');
0

精彩评论

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