Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 从元素中获取内容(URL)并将其放入jQuery代码中_Javascript_Jquery_Html - Fatal编程技术网

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");
如何获取此URL
http://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