【发布时间】:2015-11-13 15:05:03
【问题描述】:
我在其dashboard.js 文件中有一个仪表板页面.. 和一个loadfile() 函数。
我在仪表板中有一个 iframe,它是 addsite.html 和 addsite.js 文件..
我需要从addsite.js 打电话给loadfile()..
【问题讨论】:
标签: jquery html node.js function iframe
我在其dashboard.js 文件中有一个仪表板页面.. 和一个loadfile() 函数。
我在仪表板中有一个 iframe,它是 addsite.html 和 addsite.js 文件..
我需要从addsite.js 打电话给loadfile()..
【问题讨论】:
标签: jquery html node.js function iframe
在addsite.html中导入dashboard.js,然后调用它的loadfile()方法。
例如:
<script src="dashboard.js"></script>
<script src="addsite.js"></script>
<!-- ... more markup ... -->
现在,在addsite.js 中,您可以访问dashboard.js 的功能。
【讨论】:
loadfile() 用于将文件加载到父文档的 div 中。所以我不能从 iframe 中做到这一点。
iframes?这是一个不好的做法。你想让iframe 修改其父级的 div?