【问题标题】:Load external pages through iframes通过 iframe 加载外部页面
【发布时间】:2014-01-02 17:09:37
【问题描述】:

我正在尝试在 iframe 中加载网页,但总是遇到相同的错误:

Not Found

The requested URL /test/app/www.google.com was not found on this server.

Apache/2.2.17 (Ubuntu) Server at lira.tlmat.unican.es Port 80

我在参数中将 url 发送到我的页面 (mypage.html?page=www.google.com)

但它总是尝试在我的服务器中打开网页。我想加载一个外部页面。

这是我得到的错误:

GET http://myserver.es/test/app/www.google.com 404 (Not Found) newsPage.html?page=www.google.com:57
(anonymous function) newsPage.html?page=www.google.com:57
c jquery-1.9.1.min.js:3
p.fireWith jquery-1.9.1.min.js:3
b.extend.ready jquery-1.9.1.min.js:3
H

【问题讨论】:

  • 可能是服务器错误,而不是一开始的代码错误。请上传代码,以便有人可以提供帮助。
  • 我添加了我得到的错误
  • 请在 www.google.com 前添加http://
  • 它有效。我现在只是有同源域的问题。但我认为使用 iframe 解决它是不可能的。你知道怎么做吗?

标签: html iframe


【解决方案1】:

您可能需要在 iframe 中 URL 的开头添加“http://”,以表明它是外部 URL。您可以尝试将“http://”附加到页面 GET 参数吗?

【讨论】:

    猜你喜欢
    • 2013-02-06
    • 2012-12-24
    • 2021-03-28
    • 1970-01-01
    • 2010-09-28
    • 1970-01-01
    • 1970-01-01
    • 2014-02-09
    • 2023-04-09
    相关资源
    最近更新 更多