{"id":466,"date":"2023-02-25T13:38:09","date_gmt":"2023-02-25T05:38:09","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=466"},"modified":"2023-04-29T20:57:16","modified_gmt":"2023-04-29T12:57:16","slug":"iframe-implement-of-html-embeded-in-html","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/02\/25\/iframe-implement-of-html-embeded-in-html\/","title":{"rendered":"iframe\u5b9e\u73b0Html\u5d4c\u5165Html"},"content":{"rendered":"<h3>iframe\u5b9e\u73b0Html\u5d4c\u5165Html<\/h3>\n<pre><code class=\"language-html\">&lt;div class=&quot;container&quot;&gt;\n  &lt;div style=&quot;text-align: center;&quot;&gt;\n    &lt;iframe src=&quot;{{ payment_url }}&quot; frameBorder=&quot;0&quot; width=&quot;100%&quot; height=&quot;{{ iframe_height }}px&quot; scrolling=&quot;no&quot;&gt;&lt;\/iframe&gt;\n  &lt;\/div&gt;\n&lt;\/div&gt;<\/code><\/pre>\n<p><!-- more --><\/p>\n<h3>\u5751\uff1a\u5982\u4f55\u4eceiframe\u4e2d\u8df3\u51fa\u6765\uff0c\u8ba9\u6574\u4e2a\u9875\u9762\u90fd\u8df3\u8f6c<\/h3>\n<h4>\u95ee\u9898\u5f15\u51fa<\/h4>\n<p>\u4f7f\u7528iframe\u53ef\u80fd\u4f1a\u9047\u5230\u8ba9\u6574\u4e2a\u9875\u9762\u8df3\u8f6c\u5230\u67d0\u4e2aurl\uff0c\u5982\u679c\u6211\u4eec\u76f4\u63a5\u901a\u8fc7<\/p>\n<ul>\n<li><code>&lt;a&gt;<\/code>\u6807\u7b7eurl\u76f4\u63a5\u8df3\u8f6c<\/li>\n<li>JS\u4e2d\u7684window.location.href<\/li>\n<li>JS\u4e2d\u7684window.navigate()<\/li>\n<li>JS\u4e2d\u7684self.location.href<\/li>\n<\/ul>\n<p>\u90fd\u4f1a\u53ea\u8ba9iframe\u90e8\u5206\u8df3\u8f6c\uff0c\u5982\u679c\u6211\u60f3\u8981\u6574\u4e2a\u9875\u9762\u5168\u90e8\u8df3\u8f6c\u5462\uff1f<\/p>\n<h4>\u89e3\u51b3\u529e\u6cd5<\/h4>\n<p>JS\u4e2d\u7684top.location<\/p>\n<pre><code class=\"language-javascript\">top.location = &quot;http:\/\/www.baidu.com&quot;  <\/code><\/pre>\n<pre><code class=\"language-html\">&lt;div class=&quot;buttons&quot;&gt;\n  &lt;div class=&quot;pull-right&quot;&gt;&lt;a href=&quot;javascript:top.location=&#039;{{ continue }}&#039;&quot; class=&quot;btn btn-primary&quot;&gt;{{ button_continue }}&lt;\/a&gt;&lt;\/div&gt;\n&lt;\/div&gt;<\/code><\/pre>\n<blockquote>\n<p>\u6ce8\uff1a\u9875\u9762\u94fe\u63a5 *.location.href \u7528\u6cd5<\/p>\n<\/blockquote>\n<pre><code class=\"language-javascript\">top.location.href=&quot;url&quot;             \/\/\u5728\u9876\u5c42\u9875\u9762\u6253\u5f00url\uff08\u53ef\u4ee5\u7528\u5728iframe\u6846\u67b6\u91cc\u9762\u8df3\u51fa\u6846\u67b6\uff09\nself.location.href=&quot;url&quot;            \/\/\u4ec5\u5728\u672c\u9875\u9762\u6253\u5f00url\u5730\u5740\nparent.location.href=&quot;url&quot;          \/\/\u5728\u7236\u7a97\u53e3\u6253\u5f00Url\u5730\u5740\nthis.location.href=&quot;url&quot;            \/\/\u7528\u6cd5\u548cself\u7684\u7528\u6cd5\u4e00\u81f4\nif (top.location == self.location)  \/\/\u5224\u65ad\u5f53\u524dlocation \u662f\u5426\u4e3a\u9876\u5c42\u6765\u7981\u6b62iframe\u5f15\u7528<\/code><\/pre>\n<p>\u5982\u679c\u9875\u9762\u5f53\u4e2d\u6709\u81ea\u5b9a\u4e49iframe\u7684\u8bdd\uff0c\u4e5f\u53ef\u4ee5\u5c06 parent self top \u66ff\u6362\u4e3a\u81ea\u5b9a\u4e49iframe\u7684\u540d\u79f0\uff0c\u6548\u679c\u5c31\u662f\u5728\u81ea\u5b9a\u4e49iframe\u7a97\u53e3\u6253\u5f00url\u5730\u5740 <\/p>\n","protected":false},"excerpt":{"rendered":"<p>iframe\u5b9e\u73b0Html\u5d4c\u5165Html &lt;div class=&quot;container&quot;&#038; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[157],"class_list":["post-466","post","type-post","status-publish","format-standard","hentry","category-frontend-basic","tag-iframe"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/466","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=466"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/466\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=466"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=466"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=466"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}