Jquery加载同域页面
我一直在尝试使用 JQuery 的 .load() 函数加载 URL。
我有一个网址 - https://stanfordwho.stanford.edu/SWApp/authSearch.do?search=pra **&stanfordonly=checkbox&affilfilter=everyone&filters=close
我正在使用,我想称之为 - $("#StanfordProfile h2").load("https://stanfordwho.stanford.edu/SWApp/authSearch.do?search=Ajay%20Prakash&stanfordonly=checkbox&affilfilter=everyone&filters=close")
选择器在以下情况下工作我在第二页,但当我尝试上述命令时它不起作用。 我认为这会起作用,因为我是从同一网站上的另一个页面加载的(因为我不应该因为同源策略而遇到问题)。
有人可以帮忙吗?
I've been trying to load an URL using JQuery's .load() function.
I have an URL -
https://stanfordwho.stanford.edu/SWApp/authSearch.do?search=pra**&stanfordonly=checkbox&affilfilter=everyone&filters=closed
That I'm on and I 'd like to call this - $("#StanfordProfile h2").load("https://stanfordwho.stanford.edu/SWApp/authSearch.do?search=Ajay%20Prakash&stanfordonly=checkbox&affilfilter=everyone&filters=closed")
The selector works when I'm on the second page, but it's not working when I try the above command.
I thought this would work because I'm loading from another page on the same website (as in I shouldn't be coming across a problem due to the same-origin policy).
Can anyone help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许尝试使用排除域的 url
Perhaps try with a url excluding the domain