use public:property, otherwise, there is no way to pass the property through
解决方案 »
- button按钮和<a>超链接的区别?
- javascript () 括号的意思
- 有没有一种工具可以看IE调用Javascript情况的?
- 菜鸟问菜问题,高手进。急,在线等
- 求循环显示图片并可以通过按钮控制的代码.
- 好心人贴一下javascript中所有对象的属性和方法吧!
- 请兄弟帮一下忙,,,我这个程序,,哪里出问题了,,,
- 问一个简单的问题
- 老问题了,看了搜索的帖子仍然解决不了.求救!!!!!!!!
- 如何用鼠标拉出一个div 或span
- 为何找不到对象dbDocument?
- 修改disabled属性时,为何onpropertychange事件只有在设置 disabled=true 时才发生?
是不是默认属性都会有这个问题?
<public:component tagname="input2">
<public:defaults viewLinkContent=true contentEditable=false />
<public:property name="disabled" put="putDisabled" get="getDisabled" />
<attach event=oncontentready onevent="init();" />
</public:component><body>
<script language=javascript>
function putDisabled(bDisabled) {
i1.disabled = bDisabled;
i2.disabled = bDisabled;
}function getDisabled() {
return element.disabled;
}function init() {
putDisabled(disabled)
}
</script>
<input id=i1 type="text"><input id=i2 onclick=alert("OK") type="button">
</body>会产生一个stack overflow信息
<script language=javascript>
var m_bDisabled = false;
function putDisabled(bDisabled) {
m_bDisabled = bDisabled;
i1.disabled = m_bDisabled;
i2.disabled = m_bDisabled;
}function getDisabled() {
return m_bDisabled;
}</script>
我的QQ是:2649477
email: [email protected]
<SCRIPT language="JScript">
var oTopButton=oDIV=oBar=oBottomButton=null;...function init(){
oTopButton=document.createElement("<button style='position:relative;top:0;left:0;font-family:Webdings;width:17;height:20;'></button>");
oDIV.insertBefore(oTopButton);
oTopButton.innerHTML="<span style='position:relative;top:-3;left:-1;'>5</span>";
oTopButton.onmousedown=new Function("canAdd=true;plusPos()");
}...function disabled()
{
oTopButton.disabled=true;
}...
htc.html:
<HTML xmlns:IE>
<?IMPORT namespace=IE implementation="htc.htc" >
<BODY bgcolor="white">
<IE:input2 id=xx border=0 disabled=true></IE:input2><br>
<input type="button" value="change" onclick="xx.disabled = !xx.disabled">
<body>
</HTML>
htc.htc:
<public:component tagname="input2">
<public:defaults viewLinkContent=true contentEditable=false />
<attach event=oncontentready onevent="init();" />
<script language=javascript>
function init()
{
i1.setExpression("disabled","element.disabled");
i2.setExpression("disabled","element.disabled");
}
</script>
<input id=i1 type="text"><input id=i2 onclick=alert("OK") type="button" value="ok">
</public:component>
请勿过多使用动态属性:
动态属性(英文)为 Web 作者提供了一种将表达式用作属性值的方法。表达式在运行时计算,其结果值将应用于属性。这是一个强大的特性。此特性可用于减少页面上的脚本数量,但是因为必须定时重算表达式,而且该表达式经常与其他属性值相关,所以它会对性能带来消极的影响。这种情况对定位属性尤其明显。