Javascript 从元素中获取内容(URL)并将其放入jQuery代码中
我使用Javascript 从元素中获取内容(URL)并将其放入jQuery代码中,javascript,jquery,html,Javascript,Jquery,Html,我使用.load()函数从另一个页面加载内容。我的页面是http://example.org/mypage.html并包含以下jQuery: $(".content").load("http://example.org/12333.html .data"); 如何获取此URLhttp://example.org/12333.html从另一个页面动态切换:http://example.org/static.html我的jQuery代码 My static.html看起来像: <div cl
.load()
函数从另一个页面加载内容。我的页面是http://example.org/mypage.html
并包含以下jQuery:
$(".content").load("http://example.org/12333.html .data");
如何获取此URLhttp://example.org/12333.html
从另一个页面动态切换:http://example.org/static.html
我的jQuery代码
My static.html看起来像:
<div class="link">
<a href="http://example.org/12333.html">Link</a>
</div>
您可以将此id“目标”用于其他页面
$("#b" ).load( "article.html #target");
我想您可以在
static.html链接上运行`.load`,并使用href