【问题标题】:Embed webpage into another webpage将网页嵌入另一个网页
【发布时间】:2021-02-17 07:00:40
【问题描述】:

是否可以在不使用 iframe 的情况下将网页嵌入到另一个网页中?我尝试使用 iframe,但由于“X-Frame 选项/内容安全策略”,浏览器一直阻止它。谢谢。

【问题讨论】:

  • 您可以使用 Ajax 加载网页。

标签: javascript html


【解决方案1】:

您可以使用 load 方法加载页面。更多详情请参考参考链接 https://api.jquery.com/load/

#result:在下面的示例中是您在该页面内容加载中的 div 标签 ID。

 $( "#result" ).load( "ajax/test.html", function() {
      alert( "Load was performed." );
    });

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2018-08-03
  • 1970-01-01
  • 2023-03-24
  • 2021-09-07
  • 2012-07-27
  • 1970-01-01
  • 2017-04-27
  • 1970-01-01
相关资源
最近更新 更多