CSDN博客

img goody9807

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

发表于2004/7/5 13:58:00  2284人阅读

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> 加载完毕.


 

0 0

相关博文

我的热门文章

img
取 消
img