HTC中的 oncontentready、ondocumentready 、oncontentsave 、ondetach 这四个事件是做什么用的

oncontentready :
Fires when the content of the element, to which the behavior is attached, has been completely parsed

http://msdn.microsoft.com/library/default.asp?url=/workshop/components/htc/reference/events/oncontentready.asp

ondocumentready:
Fires when the behavior's containing document has been completely parsed.

http://msdn.microsoft.com/library/default.asp?url=/workshop/components/htc/reference/events/ondocumentready.asp

oncontentsave:
Fires just before the content of an element that is attached to an element behavior is saved or copied.

http://msdn.microsoft.com/library/default.asp?url=/workshop/components/htc/reference/events/oncontentsave.asp

ondetach:
Fires before a behavior is detached from an element.

http://msdn.microsoft.com/library/default.asp?url=/workshop/components/htc/reference/events/ondetach.asp

 

oncontentready 指当element所在的tag加载完毕
ondocumentready 指htc包含的document加载完毕
oncontentsave 当htc指定为可pesist,要求保存属性的时候...(例如要实现input type=text后退后能保持value的效果)
ondetach 相对 oncontentready , ondocumentready , HTC和element脱离时..

关于oncontentready和ondocumentready的区别

例如element是:
<you:tag> <option>1<option>2 </you:tag>
而htc的内容是:
<public:component>
</public:component>
<html><body>nested document</body></html>

那么oncontentready指 <you:tag/> 加载完毕
而ondocumentready指<html><body>nested document</body></html> 加载完毕.


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值