我正在使用 Iframe 来呈现嵌入的 Docusign 文档。我成功地在 Iframe 中签署了文档,并在签署后重定向到我指定的 URL。
但是重定向 URL 显示在 IFrame 内。我需要突破 iframe 并在父页面中显示。
我尝试了以下代码片段,但没有成功。
1) iframe 标记中的 th:target="_parent"
2) if (top !== self) top.location.href = self.location.href;
最佳答案
我能够找到解决方案。我只需要在 Iframe 中捕获 Docusign 重定向并将其隐藏。
<iframe id ="docusignFrame" name="docusignFrame" th:src="${docusignURL}" width="100%" height="900" onLoad="(this.contentWindow.location != '' ? DocusignCompleted(this.contentWindow.location) : void(0));">
</iframe>
<script>
function DocusignCompleted(url) {
$("#docusignFrame").hide();}
</script>
关于javascript - 在 Docusign 中突破 Iframe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44951027/