DOJO / Ajax:内容的动态加载& DOJO升级

时间:2014-07-30 12:20:55

标签: ajax dojo

在我的应用程序中,我希望在UI上显示来配置。目前,应用程序进行DOJO调用并显示UI中的所有配置。但是,如果大量配置说5000或更多,我们将面临超时问题,随后加载页面需要更多时间,应用程序会超时,因为DOJO的默认时间约为3分钟。

解决方案:我们计划进行后续的AJAX调用,并一次显示50行配置。这意味着,在显示50行配置后,应用程序将进行另一次AJAX调用,直到所有配置都加载到页面上。这将确保DOJO呼叫不会超时。我们计划推进DOJO.xhrGet或DOJO.xhrPost,这是DOJO 1.8中请求包的一部分。

现在,问题在于我的应用程序配置了非常旧版本的DOJO。因为,我们想要包含DOJO 1.8中引入的新请求方法,这里需要进行哪些更改?

我们尝试在DOJO.JS中包含请求方法,但我们可以看到它会影响其他应用程序方面。能告诉我在DOJO.JS中包含这个新包所需的步骤吗?如需参考,请查看我的DOJO.JS的片段。

任何建议都会有很大帮助。谢谢!!! :)

/ *     版权所有(c)2004-2006,Dojo基金会     保留所有权利。

Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:

    http://dojotoolkit.org/community/licensing.shtml

* /

/ *     这是Dojo的编译版本,是为部署而不是为了部署而构建的     发展。要获得可编辑的版本,请访问:

    http://dojotoolkit.org

for documentation and information on getting the source.

* /

if (typeof dojo == "undefined") {
    var dj_global = this;
    function dj_undef(_1, _2) {
        if (_2 == null) {
            _2 = dj_global;
        }
        return (typeof _2[_1] == "undefined");
    }
    if (dj_undef("djConfig")) {
        var djConfig = {};
    }
    if (dj_undef("dojo")) {
        var dojo = {};
    }
    dojo.version = {major:0,minor:3,patch:1,flag:"",revision:Number("$Rev: 4342 $".match(/[0-9]+/)[0]),toString:function() {
        with (dojo.version) {
            return major + "." + minor + "." + patch + flag + " (" + revision + ")";
        }
    }};
    dojo.evalProp = function(_3, _4, _5) {
        return (_4 && !dj_undef(_3, _4) ? _4[_3] : (_5 ? (_4[_3] = {}) : undefined));
    };
    dojo.parseObjPath = function(_6, _7, _8) {
        var _9 = (_7 != null ? _7 : dj_global);
        var _a = _6.split(".");
        var _b = _a.pop();
        for (var i = 0,l = _a.length; i < l && _9; i++) {
            _9 = dojo.evalProp(_a[i], _9, _8);
        }
        return {obj:_9,prop:_b};
    };
    dojo.evalObjPath = function(_d, _e) {
        if (typeof _d != "string") {
            return dj_global;
        }
        if (_d.indexOf(".") == -1) {
            return dojo.evalProp(_d, dj_global, _e);
        }
        var _f = dojo.parseObjPath(_d, dj_global, _e);
        if (_f) {
            return dojo.evalProp(_f.prop, _f.obj, _e);
        }
        return null;
    };
    dojo.errorToString = function(_10) {
        if (!dj_undef("message", _10)) {
            return _10.message;
        } else {
            if (!dj_undef("description", _10)) {
                return _10.description;
            } else {
                return _10;
            }
        }
    };
    dojo.raise = function(_11, _12) {
        if (_12) {
            _11 = _11 + ": " + dojo.errorToString(_12);
        }
        try {
            dojo.hostenv.println("FATAL: " + _11);
        }
        catch(e) {
        }
        throw Error(_11);
    };
    dojo.debug = function() {
    };
    dojo.debugShallow = function(obj) {
    };
    dojo.profile = {start:function() {
    },end:function() {
    },stop:function() {
    },dump:function() {
    }};
    function dj_eval(_14) {
        return dj_global.eval ? dj_global.eval(_14) : eval(_14);
    }
    dojo.unimplemented = function(_15, _16) {
        var _17 = "'" + _15 + "' not implemented";
        if (_16 != null) {
            _17 += " " + _16;
        }
        dojo.raise(_17);
    };
    dojo.deprecated = function(_18, _19, _1a) {
        var _1b = "DEPRECATED: " + _18;
        if (_19) {
            _1b += " " + _19;
        }
        if (_1a) {
            _1b += " -- will be removed in version: " + _1a;
        }
        dojo.debug(_1b);
    };
    dojo.inherits = function(_1c, _1d) {
        if (typeof _1d != "function") {
            dojo.raise("dojo.inherits: superclass argument [" + _1d + "] must be a function (subclass: [" + _1c + "']");
        }
        _1c.prototype = new _1d();
        _1c.prototype.constructor = _1c;
        _1c.superclass = _1d.prototype;
        _1c["super"] = _1d.prototype;
    };
    dojo.render = (function() {
        function vscaffold(_1e, _1f) {
            var tmp = {capable:false,support:{builtin:false,plugin:false},prefixes:_1e};
            for (var _21 in _1f) {
                tmp[_21] = false;
            }
            return tmp;
        }
        return {name:"",ver:dojo.version,os:{win:false,linux:false,osx:false},html:vscaffold(["html"], ["ie","opera","khtml","safari","moz"]),svg:vscaffold(["svg"], ["corel","adobe","batik"]),vml:vscaffold(["vml"], ["ie"]),swf:vscaffold(["Swf","Flash","Mm"], ["mm"]),swt:vscaffold(["Swt"], ["ibm"])};
    })();
    dojo.hostenv = (function() {
        var _22 = {isDebug:false,allowQueryConfig:false,baseScriptUri:"",baseRelativePath:"",libraryScriptUri:"",iePreventClobber:false,ieClobberMinimal:true,preventBackButtonFix:true,searchIds:[],parseWidgets:true};
        if (typeof djConfig == "undefined") {
            djConfig = _22;
        } else {
            for (var _23 in _22) {
                if (typeof djConfig[_23] == "undefined") {
                    djConfig[_23] = _22[_23];
                }
            }
        }
        return {name_:"(unset)",version_:"(unset)",getName:function() {
            return this.name_;
        },getVersion:function() {
            return this.version_;
        },getText:function(uri) {
            dojo.unimplemented("getText", "uri=" + uri);
        }};
    })();
    dojo.hostenv.getBaseScriptUri = function() {
        if (djConfig.baseScriptUri.length) {
            return djConfig.baseScriptUri;
        }
        var uri = new String(djConfig.libraryScriptUri || djConfig.baseRelativePath);
        if (!uri) {
            dojo.raise("Nothing returned by getLibraryScriptUri(): " + uri);
        }
        var _26 = uri.lastIndexOf("/");
        djConfig.baseScriptUri = djConfig.baseRelativePath;
        return djConfig.baseScriptUri;
    };
    (function() {
        var _27 = {pkgFileName:"__package__",loading_modules_:{},loaded_modules_:{},addedToLoadingCount:[],removedFromLoadingCount:[],inFlightCount:0,modulePrefixes_:{dojo:{name:"dojo",value:"src"}},setModulePrefix:function(_28, _29) {
            this.modulePrefixes_[_28] = {name:_28,value:_29};
        },getModulePrefix:function(_2a) {
            var mp = this.modulePrefixes_;
            if ((mp[_2a]) && (mp[_2a]["name"])) {
                return mp[_2a].value;
            }
            return _2a;
        },getTextStack:[],loadUriStack:[],loadedUris:[],post_load_:false,modulesLoadedListeners:[],unloadListeners:[],loadNotifying:false};
        for (var _2c in _27) {
            dojo.hostenv[_2c] = _27[_2c];
        }
    })();

0 个答案:

没有答案