Javascript 如何从另一个iframe内部刷新索引(父级)
我需要帮助 我有一个页面(index.html),index.html的内部有一个指向main.html的iframe。 在main.html中,我访问其他页面。示例(productlist.html) 在Index.html的顶部有一个购物车,里面有大量的产品 我想在productlist.html和refresh index.html中添加一个新产品(表单或输入),并在productlist.html中继续(而不是在main.html中) 我怎么做到的 index.htmlJavascript 如何从另一个iframe内部刷新索引(父级),javascript,jquery,html,iframe,frame,Javascript,Jquery,Html,Iframe,Frame,我需要帮助 我有一个页面(index.html),index.html的内部有一个指向main.html的iframe。 在main.html中,我访问其他页面。示例(productlist.html) 在Index.html的顶部有一个购物车,里面有大量的产品 我想在productlist.html和refresh index.html中添加一个新产品(表单或输入),并在productlist.html中继续(而不是在main.html中) 我怎么做到的 index.html <
<li class="shoppingcar-total shoppingcar-resume-item">
Total <span class="price">R$<ccom:content-block section="10022">
<ccom:field id="TotalGeral" type="virtual" /></ccom:content-block></span>
</li>
<iframe src="Get?id_sec=111" id="main_frame" name="main_frame" class="margin123" width="100%" scrolling="no" frameborder="0" seamless="seamless"> Nao e possivel mostrar o frame</iframe>
总R$
可能的,可能的,可能的
main.html(Get?id_sec=111)
productlist.html(Get?id_sec=116)
ex:Item 1价格=$20
在您的
JavaScript代码中,您可以使用窗口访问顶部框架(主HTML文档)。请注意,所有内容都必须在同一个域中才能正常工作
因此,让我们假设在主文档中有一个名为hello
的全局函数。您可以从
中的JavaScript中这样调用它:
window.top.hello();
还有其他沟通方式,例如通过收听函数发布的数据。感谢您的帮助。。我如何在我的案例中应用此函数?
ex: Item 1 price=$20
<button class="minus-button quantity-button button" type="submit" name="Adicionar" onclick="myFunc(document.getElementById('9950'));" value="-">
window.top.hello();