重构代码:移除format方法,使用公共函数库的

This commit is contained in:
Argo-Lenovo 2017-04-05 11:50:55 +08:00
parent 6101a65620
commit 32224abd46
1 changed files with 0 additions and 20 deletions

View File

@ -1,24 +1,4 @@
$(function () {
$.extend({
"format": function (source, params) {
if (params === undefined) {
return source;
}
if (arguments.length > 2 && params.constructor !== Array) {
params = $.makeArray(arguments).slice(1);
}
if (params.constructor !== Array) {
params = [params];
}
$.each(params, function (i, n) {
source = source.replace(new RegExp("\\{" + i + "\\}", "g"), function () {
return n;
});
});
return source;
}
});
var ajax = function (options) {
options = $.extend({
test: false,