【发布时间】:2016-08-30 17:09:46
【问题描述】:
这里是新手。
我刚刚学习了如何从另一个页面(相同域)中的特定 div 中获取内容并将其加载到当前页面中。
现在我正在尝试获取 jquery 代码,以根据页面的 url 链接从特定的 div id 中获取内容。这是我目前拥有的代码,与 this question 类似。
$('a.link').click(function() {
$("#div").load($(this).attr("href")); /* how to only load the #div id, based on the <a>'s href link to the page? */
});
【问题讨论】:
标签: jquery hyperlink load href