You should re-bind this JavaScript event on this element if the element be dynamically updated

本文介绍了一个涉及子框架接收后台数据并将其渲染为HTML的过程。由于元素完全更新,即使ID和名称相同,之前的事件绑定也会失效。因此,文章强调了在子框架中重新绑定事件的重要性,并详细说明了实现这一过程的具体步骤。

 

Description: the sub-frame is response for receiving data from background and renders them to HTML code. Then update the special HTML element in parent. Since the element has been updated totally, even though they are the same id and name, the events which bind on them before will not be effective. We have to bind these events again in sub-frame.

And you also invoke parent function do it in the sub-frame. Explicitly like this:

..getHtmlFromBackgound;

..renderHTML;

..updateParentHtmlElement;

window.parent.rebind();

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值