亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

幾個常用的Javascript函數

系統 2982 0


// *******************************************************
// replacements for unsupported array functions (because arrayname.push(var)
// and arrayname.pop() are not implemented in IE until version 5.5)
function thearrayisgood(thearray,i) {
? ?? ?? ?if ((thearray[i] == "undefined") || (thearray[i] == "") || (thearray[i] == null))
? ?? ?? ?? ? return false;
? ?? ?? ?else
? ?? ?? ?? ? return true;
}

function getarraysize(thearray) {
// replacement for arrayname.length property
? ?? ???for (i = 0; i < thearray.length; i++) {
? ?? ?? ?? ?? ? if ((thearray[i] == "undefined") || (thearray[i] == "") || (thearray[i] == null))
? ?? ?? ?? ?? ?? ?? ?? ?return i;
? ?? ?? ?? ?? ? }
? ?? ???return thearray.length;
}

function arraypush(thearray,value) {
// replacement for arrayname.push(value)
? ?? ???thearraysize = getarraysize(thearray);
? ?? ???thearray[thearraysize] = value;
? ?? ???return thearray[thearraysize];
}

function arraypop(thearray) {
// replacement for arrayname.pop()
? ?? ???thearraysize = getarraysize(thearray);
? ?? ???retval = thearray[thearraysize - 1];
? ?? ???delete thearray[thearraysize - 1];

??????? thearray.length--; <<==我加了這句,很關鍵,否則出錯
????????return retval;
}

// *******************************************************

另外給出網上幾個老外寫的

function Array_pop() {
? var response = this[this.length - 1]
? this.length--
? return response
? }

if (typeof(Array.prototype.pop) == "undefined") {
? Array.prototype.pop = Array_pop
? }

function Array_push() {
? var A_p = 0
? for (A_p = 0; A_p < arguments.length; A_p++) {
?? this[this.length] = arguments[A_p]
?? }
? return this.length
? }

if (typeof Array.prototype.push == "undefined") {
? Array.prototype.push = Array_push
? }



Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=558849


幾個常用的Javascript函數


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 成人免费视频视频在线不卡 | 大学生一级黄色片 | 性做久久久久久久久男女 | 91久久国产综合精品女同国语 | 亚洲视频在线观看不卡 | 亚洲美女性视频 | 中文字幕一区视频一线 | 免费观看日本污污ww网站一区 | 四虎2021地址入口 | 中文字幕色婷婷在线精品中 | 国产牛牛 | 99热成人精品热久久66 | 色汉综合 | 久久视频免费观看 | 色好看在线视频播放 | 欧洲精品在线观看 | 亚洲天天做夜夜做天天欢人人 | 国产香蕉视频 | 特级全黄一级毛片视频 | 一日本道加勒比高清一二三 | 99九九视频| 欧美深度肠交 | 天天插天天舔 | 天天草天天干天天 | 久久毛片 | 精品欧美一区二区三区精品久久 | 日韩高清欧美精品亚洲 | 色淫影院| 国产成人免费不卡在线观看 | 97影院2| 精品福利国产 | 日韩视频在线观看一区二区 | 九九热在线视频观看 | 天天干 夜夜操 | 四虎影院在线观看免费 | 青青99| 亚洲一级视频在线观看 | 久久这里一区二区精品 | 久久影视免费体验区午夜啪啪 | 在线播放不卡 | 国产 高清 在线 |