【问题标题】:load a page using POST to iframe使用 POST 将页面加载到 iframe
【发布时间】:2012-05-17 14:12:38
【问题描述】:

我想创建一个内部可见的其他页面的 iframe。该页面在我的域之外。通常我会这样做:

$('<iframe />').attr('src','www.thepage.com?data=1').appendTo('body')

但是如果 www.thepage.com 可以通过 POST 而不是 GET 访问,我应该如何加载它? $.ajax( type:'POST',...)Origin null is not allowed by Access-Control-Allow-Origin. 而失败

【问题讨论】:

    标签: jquery ajax iframe


    【解决方案1】:

    加载一个包含您需要(隐藏)字段的表单的临时页面,并使用 Javascript 提交表单。

    这恰好是我之前提出的问题。 Response.Redirect with POST instead of Get?

    看看帕夫洛的回答。您可以看到他是如何创建一个带有在加载正文时提交的表单的 html 页面。

    【讨论】:

      猜你喜欢
      • 2018-05-04
      • 1970-01-01
      • 2014-06-29
      • 1970-01-01
      • 2012-11-08
      • 1970-01-01
      • 1970-01-01
      • 2011-01-13
      • 2015-03-31
      相关资源
      最近更新 更多