Jquery加载同域页面

发布于 2024-12-02 02:33:35 字数 609 浏览 0 评论 0原文

我一直在尝试使用 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技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

旧时浪漫 2024-12-09 02:33:35

也许尝试使用排除域的 url

$("#StanfordProfile h2").load("/SWApp/authSearch.do?search=Ajay%20Prakash&stanfordonly=checkbox&affilfilter=everyone&filters=closed");

Perhaps try with a url excluding the domain

$("#StanfordProfile h2").load("/SWApp/authSearch.do?search=Ajay%20Prakash&stanfordonly=checkbox&affilfilter=everyone&filters=closed");
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文