【发布时间】:2021-07-12 17:35:49
【问题描述】:
这可能是非常基本的,但我们将不胜感激。
我有以下脚本,可以添加到自定义构建的 Web 应用程序中,并在其中嵌入 iframe 中的另一个页面。
$(function() {
$('#customframe').after('<iframe src="https://www.myurl.com" style="width:100%;height:200px"></iframe>');
});
我需要在 iframe 中包含一个查询参数,如下所示
$(function() {
$('#customframe').after('<iframe src="https://www.myurl.com/page.html?id=ThisRecordId" style="width:100%;height:200px"></iframe>');
});
ThisRecordId 变量已在 DOM 中可用。
如果我转到浏览器控制台并输入ThisRecordId,它会显示我需要的 iFrame 值。
我只是在努力让它发挥作用。
提前致谢。
【问题讨论】:
标签: javascript jquery iframe