prototype1.4简介_yj(14)

2021-04-05 09:37

prototype1.4简介_yj

下面的例子用提示框显示0-9。 <script>

function demoTimes(){ var n = 10;

n.times(function(index){ alert(index); });

/*************************** * you could have also used: * (10).times( .... ); ***************************/ }

</script>

<input type=button value="Test Number.times()" onclick="demoTimes()">

让我们看看如何运用这些扩展。

<input type=checkbox id=myChk value=1> Test? <script>

//declaring the class

var CheckboxWatcher = Class.create();

//defining the rest of the class implementation CheckboxWatcher.prototype = {

initialize: function(chkBox, message) { this.chkBox = $(chkBox); this.message = message;

//assigning our method to the event

this.chkBox.onclick =

this.showMessage.bindAsEventListener(this); },

showMessage: function(evt) {


prototype1.4简介_yj(14).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:二年级持轻物掷远说课稿

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: