如何使用jquery将多个链接重定向到网站上的div?

时间:2016-02-06 02:23:11

标签: jquery html jquery-ui autocomplete

我有一个目标网页,其中包含许多指向我网站域中各个html文件的链接。是否可以在我的目标网页上的div中加载这些其他html文件?

意思是,而不是:

<a href="#" ng-click='flipCard(0)'>{{table[0]}}</a>

<button  ng-click="setHands()">Reset</button>

有没有办法做到这一点:

Homepage.com
  Link 1 > takes you to new page homepage.com/link1.html
  Link 2 > takes you to this page homepage.com/link2.html
  Link 3 > takes you to this other page homepage.com/link3.html

我可以使用jqueryui将自动完成链接到输入字段,但我无法弄清楚如何链接所选术语以加载新页面。

谢谢

1 个答案:

答案 0 :(得分:0)

jQuery .load() 可能正是您所寻找的。您甚至可以在该页面上指定要从中拉出的容器元素。

$('.content').load('homepage.com/link1.html #container');
相关问题