javascript一点特殊用法

2018-10-15 17:04

阅读:533

,可以交换如:
<scripttype=text/javascript>
/*functionupdate()
{
varname=dwr.util.getValue(demoName);
Demo.sayHello(name,function(data){
dwr.util.setValue(demoReply,data);
dwr.util.setValue(demoReply2,data);
});
}*/
/*
functionsetData(data)
{
dwr.util.setValue(demoReply,data);
dwr.util.setValue(demoReply2,data);
}
functionupdate()
{
varname=dwr.util.getValue(demoName);
Demo.sayHello(name,setData);
}
*/
functionupdate()
{
varname=dwr.util.getValue(demoName);
varname2=$(demoName).value;
varname3=document.getElementById(demoName).value;
alert(name2+name3+name);
Demo.sayHello(name,{
callback:function(data)
{
dwr.util.setValue(demoReply,data);
dwr.util.setValue(demoReply2,data);
}
});
}
hot=functionhot(){alert(Sweat.);}
cold=functioncold(){alert(Shiver.);}
functionswap()
{
temp=hot;
hot=cold;
cold=temp;
alert(Swap.);
}
</script>

两个函数可以交换,就像普通变量一样。


评论


亲,登录后才可以留言!