Load child from external page

淺唱寂寞╮ 提交于 2019-12-11 16:37:14

问题


Can someone help me edit this jQuery so that instead of pulling the #product_name_source from anywhere on the page it takes it from within the #Altitude div. As you can see, I've tried something there but it seems that you can't have multiple divs in a URL http://google.com #parent #child. Anyone able to help?

$('body').ready(function(){

    var product_name = 'Altitude';

    $('#product_name').load('http://cdn.jeremyblaze.com/theme_info.html #' + product_name + '#product_name_source');

});

回答1:


Try this

$('body').ready(function(){
var product_name = 'Altitude';

$('#product_name').load('http://cdn.jeremyblaze.com/theme_info.html' +'#product_name_source', {pName:product_name });



回答2:


I've found that this works.

$('#product_name').load('http://cdn.jeremyblaze.com/theme_info.html #' + product_name + ' #product_name_source');


来源:https://stackoverflow.com/questions/18245280/load-child-from-external-page

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!