怎么编写JS的Array List 求高手解答 怎么编写JS的Array List 求高手解答 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://www.wangchao.net.cn/bbsdetail_67452.html var l=new ArrayList(); l.add(1); l.add(2); l.add(3); 大姐 是在Java Script 里面写 我知道是在JavaScript里写,关键是你没有看清楚我的问题 JS的Array本来就是不定长度的数组....有必要写ArrayList吗? 简单的写了一个 <script type="text/javascript"> function ArrayList() { this._values = []; } ArrayList.prototype.add = function(item) { this._values.push(item); } ArrayList.prototype.getCount = function() { return this._values.length; } ArrayList.prototype.getItem = function(index) { return this._values[index]; } var arrayList = new ArrayList(); arrayList.add(1); arrayList.add(2); window.alert(arrayList.getCount()); window.alert(arrayList.getItem(0)); </script> js点击事件在360浏览器下无效? 搞好再追加倍的分数,一个漂亮滑动门的实现 javascript调用问题,急 用JAVESCRIPT修改控件大小,为什么不执行?加上alert("df")才执行 请问,怎样在父页面里用JS给iframe子页面加载CSS样式? 求htmlarea3.0rc1中文版 求救高手,高难问题。如何知道我的输入 怎么判断页面的内容是否被修改。?! 请大神指导如何系统的学习Javascript 动态添加select class="selectpicker"无法生效问题 弹出一个窗口(页面)问题。 我想买本jquery的书,高手请教。
l.add(1);
l.add(2);
l.add(3);
有必要写ArrayList吗?
{
this._values = [];
} ArrayList.prototype.add = function(item)
{
this._values.push(item);
} ArrayList.prototype.getCount = function()
{
return this._values.length;
} ArrayList.prototype.getItem = function(index)
{
return this._values[index];
} var arrayList = new ArrayList();
arrayList.add(1);
arrayList.add(2);
window.alert(arrayList.getCount());
window.alert(arrayList.getItem(0));
</script>