首页 > Web开发 > 详细

director.js 支持中文路径

时间:2016-09-28 19:20:40      阅读:238      评论:0      收藏:0      [点我收藏+]

1.director.js 支持中文路径

390行 return mod === str ? "([._a-zA-Z0-9-%()]+)" : mod;

修改正则 return mod === str ? "([._a-zA-Z0-9-%()]+|[\u4E00-\u9FFF]+)" : mod;

2.ie8bug

(1)不支持isArray方法文件头加上

if (!Array.isArray) {
  Array.isArray = function(arg) {
    return Object.prototype.toString.call(arg) === ‘[object Array]‘;
  };
}

 (2)不支持filter方法

if (!Array.prototype.filter)
{
  Array.prototype.filter = function(fun /*, thisArg */)
  {
    "use strict";

    if (this === void 0 || this === null)
      throw new TypeError();

    var t = Object(this);
    var len = t.length >>> 0;
    if (typeof fun !== "function")
      throw new TypeError();

    var res = [];
    var thisArg = arguments.length >= 2 ? arguments[1] : void 0;
    for (var i = 0; i < len; i++)
    {
      if (i in t)
      {
        var val = t[i];

        // NOTE: Technically this should Object.defineProperty at
        //       the next index, as push can be affected by
        //       properties on Object.prototype and Array.prototype.
        //       But that method‘s new, and collisions should be
        //       rare, so use the more-compatible alternative.
        if (fun.call(thisArg, val, i, t))
          res.push(val);
      }
    }

    return res;
  };
}

 

director.js 支持中文路径

原文:http://www.cnblogs.com/-totoro/p/5917474.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!