天天躁日日躁狠狠躁AV麻豆-天天躁人人躁人人躁狂躁-天天澡夜夜澡人人澡-天天影视香色欲综合网-国产成人女人在线视频观看-国产成人女人视频在线观看

fix-ie5.js擴展在IE5下不能使用的幾個方法

在IE5下的Javascript:
Array不支持push(),pop();Function不支持apply();String對象的replace方法不支持替換成一個處理函數。
使用下面的代碼就可修復上述方法在IE5下無效的問題。
/*
  fix-ie5.js, version 1.0 (pre-release) (2005/05/15) x3
  Copyright 2005, Dean Edwards
  Web: http://dean.edwards.name/

  This software is licensed under the CC-GNU LGPL
  Web: http://creativecommons.org/licenses/LGPL/2.1/
*/

if (/MSIE 5.0/.test(navigator.userAgent)) new function() {

  var $$apply = function($function, $object, $arguments) {
    $function.apply($object, $arguments);
  };

  // fix String.replace
  if (''.replace(/^/, String)) {
    // preserve String.replace
    var _stringReplace = String.prototype.replace;
    // create String.replace for handling functions
    var _functionReplace = function($expression, $replacement) {
      var $match, $newString = "", $string = this;
      while ($string && ($match = $expression.exec($string))) {
        $newString += $string.slice(0, $match.index) + $$apply($replacement, this, $match);
        $string = $string.slice($match.lastIndex);
      }
      return $newString + $string;
    };
    // replace String.replace
    String.prototype.replace = function ($expression, $replacement) {
      this.replace = (typeof $replacement == "function") ? _functionReplace : _stringReplace;
      return this.replace($expression, $replacement);
    };
  }

  // fix Function.apply
  if (!Function.apply) {
    var APPLY = "apply-" + Number(new Date);
    $$apply = function(f, o, a) {
      var r;
      o[APPLY] = f;
      switch (a.length) { // deconstruct for speed
        case 0: r = o[APPLY](); break;
        case 1: r = o[APPLY](a[0]); break;
        case 2: r = o[APPLY](a[0], a[1]); break;
        case 3: r = o[APPLY](a[0], a[1], a[2]); break;
        case 4: r = o[APPLY](a[0], a[1], a[2], a[3]); break;
        default:
          var aa = [], i = a.length - 1;
          do aa[i] = "a[" + i + "]"; while (i--);
          eval("r=o[APPLY](" + aa + ")");
      }
      delete o[APPLY];
      return r;
    };
    // fix ICommon
    ICommon.valueOf.prototype.inherit = function() {
      return $$apply(arguments.callee.caller.ancestor, this, arguments);
    };
  }

  // array fixes
  if (![].push) Array.prototype.push = function() {
    for (var i = 0; i < arguments.length; i++) {
      this[this.length] = arguments[i];
    }
    return this.length;
  };
  if (![].pop) Array.prototype.pop = function() {
    var $item = this[this.length - 1];
    this.length--;
    return $item;
  };
};

JavaScript技術fix-ie5.js擴展在IE5下不能使用的幾個方法,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 一个人HD高清在线观看免费视频 | 日本漫画母亲口工子全彩 | 777久久人妻少妇嫩草AV蜜桃 | 国产 在线 亚洲 欧美 动漫 | 国产成人一区二区三中文 | 伊人大香线蕉精品在线播放 | 成视频高清 | 三级aa久久 | 中国老太性色xxxxxhd | 国产成人午夜精品免费视频 | 欧美一区二区三区播放 | 国产精品久久免费视频 | 国产午夜精品理论片影院 | 免费观看激烈日板子 | 午夜看片a福利在线观看 | 电影内射视频免费观看 | 火影小南被爆羞羞网站 | 国产人A片在线乱码视频 | 超碰国产视频免费播放 | 3DNagoonimation动漫 | 亚洲精品第一综合99久久 | 麻豆免费观看高清完整视频在线 | 狠狠色丁香久久婷婷综合_中 | 理论片午午伦夜理片I | 亚洲色欲色欲WWW在线丝 | 大乳牛奶女magnet | 搡女人免费免费视频观看 | 久久亚洲精品无码A片大香大香 | 久久激情网 | 日韩男明星 | 久久久久国产一级毛片高清片 | 乱叫抽搐流白浆免费视频 | 水蜜桃亚洲一二三四在线 | 边做边爱免费视频播放 | 日本激情网址 | av视频在线免播放观看 | 日本护士在线观看 | 东京热一本无码av | 欧美大片免费观看 | 中文字幕人成乱码熟女APP | 看了n遍舍不得删的黄文 |