DIV CSS 佈局教程網

復制js對象方法
編輯:JavaScript綜合知識     
復制js對象方法,需要的朋友可以參考下   復制代碼 代碼如下:


CSSCommonJS.DeepCopy = function (json) {
    if (typeof json == 'number' || typeof json == 'string' || typeof json == 'boolean') {
        return json;
    } else if (typeof json == 'object') {
        if (json instanceof Array) {
            var newArr = [], i, len = json.length;
            for (i = 0; i < len; i++) {
                newArr[i] = arguments.callee(json[i]);
            }
            return newArr;
        } else {
            var newObj = {};
            for (var name in json) {
                newObj[name] = arguments.callee(json[name]);
            }
            return newObj;
        }
    }
}

XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved