 Today we will talk about the possibility of dynamic preloading of the library on demand. Initially, to use the framework, you need to connect the style file first, then the adapter, which implements the basic functionality, and if you use another AJAX library as a basis, first and its distribution. And only then the main ExtJS file, or its debug version at the development stage. Of course, combining all files into one, gzip compression and other techniques will help reduce download time. But…
 Today we will talk about the possibility of dynamic preloading of the library on demand. Initially, to use the framework, you need to connect the style file first, then the adapter, which implements the basic functionality, and if you use another AJAX library as a basis, first and its distribution. And only then the main ExtJS file, or its debug version at the development stage. Of course, combining all files into one, gzip compression and other techniques will help reduce download time. But…Ext.BLANK_IMAGE_URL = '/inc/extjs/resources/images/default/s.gif' ; Ext.enableGarbageCollector = true ; // _isLoadedExtJS = false ; function _loadExtJS_andRun(callback) { if (_isLoadedExtJS == false ) // { // JQuery $.getScript( '/inc/extjs/ext-all.js' , function (data, textStatus){ if (textStatus == 'success' ) { _isLoadedExtJS = true ; Ext.state.Manager.setProvider( new Ext.state.CookieProvider({ path: "/" , expires: new Date( new Date().getTime()+(1000*60*60*24*30)) })); Ext.QuickTips.init(); // callback(); } }); } else { callback(); } } * This source code was highlighted with Source Code Highlighter .
Ext.BLANK_IMAGE_URL = '/inc/extjs/resources/images/default/s.gif' ; Ext.enableGarbageCollector = true ; // _isLoadedExtJS = false ; function _loadExtJS_andRun(callback) { if (_isLoadedExtJS == false ) // { // JQuery $.getScript( '/inc/extjs/ext-all.js' , function (data, textStatus){ if (textStatus == 'success' ) { _isLoadedExtJS = true ; Ext.state.Manager.setProvider( new Ext.state.CookieProvider({ path: "/" , expires: new Date( new Date().getTime()+(1000*60*60*24*30)) })); Ext.QuickTips.init(); // callback(); } }); } else { callback(); } } * This source code was highlighted with Source Code Highlighter .
Ext.BLANK_IMAGE_URL = '/inc/extjs/resources/images/default/s.gif' ; Ext.enableGarbageCollector = true ; // _isLoadedExtJS = false ; function _loadExtJS_andRun(callback) { if (_isLoadedExtJS == false ) // { // JQuery $.getScript( '/inc/extjs/ext-all.js' , function (data, textStatus){ if (textStatus == 'success' ) { _isLoadedExtJS = true ; Ext.state.Manager.setProvider( new Ext.state.CookieProvider({ path: "/" , expires: new Date( new Date().getTime()+(1000*60*60*24*30)) })); Ext.QuickTips.init(); // callback(); } }); } else { callback(); } } * This source code was highlighted with Source Code Highlighter .
Ext.BLANK_IMAGE_URL = '/inc/extjs/resources/images/default/s.gif' ; Ext.enableGarbageCollector = true ; // _isLoadedExtJS = false ; function _loadExtJS_andRun(callback) { if (_isLoadedExtJS == false ) // { // JQuery $.getScript( '/inc/extjs/ext-all.js' , function (data, textStatus){ if (textStatus == 'success' ) { _isLoadedExtJS = true ; Ext.state.Manager.setProvider( new Ext.state.CookieProvider({ path: "/" , expires: new Date( new Date().getTime()+(1000*60*60*24*30)) })); Ext.QuickTips.init(); // callback(); } }); } else { callback(); } } * This source code was highlighted with Source Code Highlighter .
Ext.BLANK_IMAGE_URL = '/inc/extjs/resources/images/default/s.gif' ; Ext.enableGarbageCollector = true ; // _isLoadedExtJS = false ; function _loadExtJS_andRun(callback) { if (_isLoadedExtJS == false ) // { // JQuery $.getScript( '/inc/extjs/ext-all.js' , function (data, textStatus){ if (textStatus == 'success' ) { _isLoadedExtJS = true ; Ext.state.Manager.setProvider( new Ext.state.CookieProvider({ path: "/" , expires: new Date( new Date().getTime()+(1000*60*60*24*30)) })); Ext.QuickTips.init(); // callback(); } }); } else { callback(); } } * This source code was highlighted with Source Code Highlighter .
Ext.BLANK_IMAGE_URL = '/inc/extjs/resources/images/default/s.gif' ; Ext.enableGarbageCollector = true ; // _isLoadedExtJS = false ; function _loadExtJS_andRun(callback) { if (_isLoadedExtJS == false ) // { // JQuery $.getScript( '/inc/extjs/ext-all.js' , function (data, textStatus){ if (textStatus == 'success' ) { _isLoadedExtJS = true ; Ext.state.Manager.setProvider( new Ext.state.CookieProvider({ path: "/" , expires: new Date( new Date().getTime()+(1000*60*60*24*30)) })); Ext.QuickTips.init(); // callback(); } }); } else { callback(); } } * This source code was highlighted with Source Code Highlighter .
Ext.BLANK_IMAGE_URL = '/inc/extjs/resources/images/default/s.gif' ; Ext.enableGarbageCollector = true ; // _isLoadedExtJS = false ; function _loadExtJS_andRun(callback) { if (_isLoadedExtJS == false ) // { // JQuery $.getScript( '/inc/extjs/ext-all.js' , function (data, textStatus){ if (textStatus == 'success' ) { _isLoadedExtJS = true ; Ext.state.Manager.setProvider( new Ext.state.CookieProvider({ path: "/" , expires: new Date( new Date().getTime()+(1000*60*60*24*30)) })); Ext.QuickTips.init(); // callback(); } }); } else { callback(); } } * This source code was highlighted with Source Code Highlighter .
Ext.BLANK_IMAGE_URL = '/inc/extjs/resources/images/default/s.gif' ; Ext.enableGarbageCollector = true ; // _isLoadedExtJS = false ; function _loadExtJS_andRun(callback) { if (_isLoadedExtJS == false ) // { // JQuery $.getScript( '/inc/extjs/ext-all.js' , function (data, textStatus){ if (textStatus == 'success' ) { _isLoadedExtJS = true ; Ext.state.Manager.setProvider( new Ext.state.CookieProvider({ path: "/" , expires: new Date( new Date().getTime()+(1000*60*60*24*30)) })); Ext.QuickTips.init(); // callback(); } }); } else { callback(); } } * This source code was highlighted with Source Code Highlighter .
Ext.BLANK_IMAGE_URL = '/inc/extjs/resources/images/default/s.gif' ; Ext.enableGarbageCollector = true ; // _isLoadedExtJS = false ; function _loadExtJS_andRun(callback) { if (_isLoadedExtJS == false ) // { // JQuery $.getScript( '/inc/extjs/ext-all.js' , function (data, textStatus){ if (textStatus == 'success' ) { _isLoadedExtJS = true ; Ext.state.Manager.setProvider( new Ext.state.CookieProvider({ path: "/" , expires: new Date( new Date().getTime()+(1000*60*60*24*30)) })); Ext.QuickTips.init(); // callback(); } }); } else { callback(); } } * This source code was highlighted with Source Code Highlighter .
Ext.BLANK_IMAGE_URL = '/inc/extjs/resources/images/default/s.gif' ; Ext.enableGarbageCollector = true ; // _isLoadedExtJS = false ; function _loadExtJS_andRun(callback) { if (_isLoadedExtJS == false ) // { // JQuery $.getScript( '/inc/extjs/ext-all.js' , function (data, textStatus){ if (textStatus == 'success' ) { _isLoadedExtJS = true ; Ext.state.Manager.setProvider( new Ext.state.CookieProvider({ path: "/" , expires: new Date( new Date().getTime()+(1000*60*60*24*30)) })); Ext.QuickTips.init(); // callback(); } }); } else { callback(); } } * This source code was highlighted with Source Code Highlighter .
Ext.BLANK_IMAGE_URL = '/inc/extjs/resources/images/default/s.gif' ; Ext.enableGarbageCollector = true ; // _isLoadedExtJS = false ; function _loadExtJS_andRun(callback) { if (_isLoadedExtJS == false ) // { // JQuery $.getScript( '/inc/extjs/ext-all.js' , function (data, textStatus){ if (textStatus == 'success' ) { _isLoadedExtJS = true ; Ext.state.Manager.setProvider( new Ext.state.CookieProvider({ path: "/" , expires: new Date( new Date().getTime()+(1000*60*60*24*30)) })); Ext.QuickTips.init(); // callback(); } }); } else { callback(); } } * This source code was highlighted with Source Code Highlighter .
Ext.BLANK_IMAGE_URL = '/inc/extjs/resources/images/default/s.gif' ; Ext.enableGarbageCollector = true ; // _isLoadedExtJS = false ; function _loadExtJS_andRun(callback) { if (_isLoadedExtJS == false ) // { // JQuery $.getScript( '/inc/extjs/ext-all.js' , function (data, textStatus){ if (textStatus == 'success' ) { _isLoadedExtJS = true ; Ext.state.Manager.setProvider( new Ext.state.CookieProvider({ path: "/" , expires: new Date( new Date().getTime()+(1000*60*60*24*30)) })); Ext.QuickTips.init(); // callback(); } }); } else { callback(); } } * This source code was highlighted with Source Code Highlighter .
Ext.BLANK_IMAGE_URL = '/inc/extjs/resources/images/default/s.gif' ; Ext.enableGarbageCollector = true ; // _isLoadedExtJS = false ; function _loadExtJS_andRun(callback) { if (_isLoadedExtJS == false ) // { // JQuery $.getScript( '/inc/extjs/ext-all.js' , function (data, textStatus){ if (textStatus == 'success' ) { _isLoadedExtJS = true ; Ext.state.Manager.setProvider( new Ext.state.CookieProvider({ path: "/" , expires: new Date( new Date().getTime()+(1000*60*60*24*30)) })); Ext.QuickTips.init(); // callback(); } }); } else { callback(); } } * This source code was highlighted with Source Code Highlighter .
Ext.BLANK_IMAGE_URL = '/inc/extjs/resources/images/default/s.gif' ; Ext.enableGarbageCollector = true ; // _isLoadedExtJS = false ; function _loadExtJS_andRun(callback) { if (_isLoadedExtJS == false ) // { // JQuery $.getScript( '/inc/extjs/ext-all.js' , function (data, textStatus){ if (textStatus == 'success' ) { _isLoadedExtJS = true ; Ext.state.Manager.setProvider( new Ext.state.CookieProvider({ path: "/" , expires: new Date( new Date().getTime()+(1000*60*60*24*30)) })); Ext.QuickTips.init(); // callback(); } }); } else { callback(); } } * This source code was highlighted with Source Code Highlighter .
Ext.BLANK_IMAGE_URL = '/inc/extjs/resources/images/default/s.gif' ; Ext.enableGarbageCollector = true ; // _isLoadedExtJS = false ; function _loadExtJS_andRun(callback) { if (_isLoadedExtJS == false ) // { // JQuery $.getScript( '/inc/extjs/ext-all.js' , function (data, textStatus){ if (textStatus == 'success' ) { _isLoadedExtJS = true ; Ext.state.Manager.setProvider( new Ext.state.CookieProvider({ path: "/" , expires: new Date( new Date().getTime()+(1000*60*60*24*30)) })); Ext.QuickTips.init(); // callback(); } }); } else { callback(); } } * This source code was highlighted with Source Code Highlighter .
Ext.BLANK_IMAGE_URL = '/inc/extjs/resources/images/default/s.gif' ; Ext.enableGarbageCollector = true ; // _isLoadedExtJS = false ; function _loadExtJS_andRun(callback) { if (_isLoadedExtJS == false ) // { // JQuery $.getScript( '/inc/extjs/ext-all.js' , function (data, textStatus){ if (textStatus == 'success' ) { _isLoadedExtJS = true ; Ext.state.Manager.setProvider( new Ext.state.CookieProvider({ path: "/" , expires: new Date( new Date().getTime()+(1000*60*60*24*30)) })); Ext.QuickTips.init(); // callback(); } }); } else { callback(); } } * This source code was highlighted with Source Code Highlighter .
Ext.BLANK_IMAGE_URL = '/inc/extjs/resources/images/default/s.gif' ; Ext.enableGarbageCollector = true ; // _isLoadedExtJS = false ; function _loadExtJS_andRun(callback) { if (_isLoadedExtJS == false ) // { // JQuery $.getScript( '/inc/extjs/ext-all.js' , function (data, textStatus){ if (textStatus == 'success' ) { _isLoadedExtJS = true ; Ext.state.Manager.setProvider( new Ext.state.CookieProvider({ path: "/" , expires: new Date( new Date().getTime()+(1000*60*60*24*30)) })); Ext.QuickTips.init(); // callback(); } }); } else { callback(); } } * This source code was highlighted with Source Code Highlighter .
Ext.BLANK_IMAGE_URL = '/inc/extjs/resources/images/default/s.gif' ; Ext.enableGarbageCollector = true ; // _isLoadedExtJS = false ; function _loadExtJS_andRun(callback) { if (_isLoadedExtJS == false ) // { // JQuery $.getScript( '/inc/extjs/ext-all.js' , function (data, textStatus){ if (textStatus == 'success' ) { _isLoadedExtJS = true ; Ext.state.Manager.setProvider( new Ext.state.CookieProvider({ path: "/" , expires: new Date( new Date().getTime()+(1000*60*60*24*30)) })); Ext.QuickTips.init(); // callback(); } }); } else { callback(); } } * This source code was highlighted with Source Code Highlighter .
Ext.BLANK_IMAGE_URL = '/inc/extjs/resources/images/default/s.gif' ; Ext.enableGarbageCollector = true ; // _isLoadedExtJS = false ; function _loadExtJS_andRun(callback) { if (_isLoadedExtJS == false ) // { // JQuery $.getScript( '/inc/extjs/ext-all.js' , function (data, textStatus){ if (textStatus == 'success' ) { _isLoadedExtJS = true ; Ext.state.Manager.setProvider( new Ext.state.CookieProvider({ path: "/" , expires: new Date( new Date().getTime()+(1000*60*60*24*30)) })); Ext.QuickTips.init(); // callback(); } }); } else { callback(); } } * This source code was highlighted with Source Code Highlighter .
Ext.BLANK_IMAGE_URL = '/inc/extjs/resources/images/default/s.gif' ; Ext.enableGarbageCollector = true ; // _isLoadedExtJS = false ; function _loadExtJS_andRun(callback) { if (_isLoadedExtJS == false ) // { // JQuery $.getScript( '/inc/extjs/ext-all.js' , function (data, textStatus){ if (textStatus == 'success' ) { _isLoadedExtJS = true ; Ext.state.Manager.setProvider( new Ext.state.CookieProvider({ path: "/" , expires: new Date( new Date().getTime()+(1000*60*60*24*30)) })); Ext.QuickTips.init(); // callback(); } }); } else { callback(); } } * This source code was highlighted with Source Code Highlighter .
Ext.BLANK_IMAGE_URL = '/inc/extjs/resources/images/default/s.gif' ; Ext.enableGarbageCollector = true ; // _isLoadedExtJS = false ; function _loadExtJS_andRun(callback) { if (_isLoadedExtJS == false ) // { // JQuery $.getScript( '/inc/extjs/ext-all.js' , function (data, textStatus){ if (textStatus == 'success' ) { _isLoadedExtJS = true ; Ext.state.Manager.setProvider( new Ext.state.CookieProvider({ path: "/" , expires: new Date( new Date().getTime()+(1000*60*60*24*30)) })); Ext.QuickTips.init(); // callback(); } }); } else { callback(); } } * This source code was highlighted with Source Code Highlighter .
Ext.BLANK_IMAGE_URL = '/inc/extjs/resources/images/default/s.gif' ; Ext.enableGarbageCollector = true ; // _isLoadedExtJS = false ; function _loadExtJS_andRun(callback) { if (_isLoadedExtJS == false ) // { // JQuery $.getScript( '/inc/extjs/ext-all.js' , function (data, textStatus){ if (textStatus == 'success' ) { _isLoadedExtJS = true ; Ext.state.Manager.setProvider( new Ext.state.CookieProvider({ path: "/" , expires: new Date( new Date().getTime()+(1000*60*60*24*30)) })); Ext.QuickTips.init(); // callback(); } }); } else { callback(); } } * This source code was highlighted with Source Code Highlighter .
Ext.BLANK_IMAGE_URL = '/inc/extjs/resources/images/default/s.gif' ; Ext.enableGarbageCollector = true ; // _isLoadedExtJS = false ; function _loadExtJS_andRun(callback) { if (_isLoadedExtJS == false ) // { // JQuery $.getScript( '/inc/extjs/ext-all.js' , function (data, textStatus){ if (textStatus == 'success' ) { _isLoadedExtJS = true ; Ext.state.Manager.setProvider( new Ext.state.CookieProvider({ path: "/" , expires: new Date( new Date().getTime()+(1000*60*60*24*30)) })); Ext.QuickTips.init(); // callback(); } }); } else { callback(); } } * This source code was highlighted with Source Code Highlighter .
Ext.BLANK_IMAGE_URL = '/inc/extjs/resources/images/default/s.gif' ; Ext.enableGarbageCollector = true ; // _isLoadedExtJS = false ; function _loadExtJS_andRun(callback) { if (_isLoadedExtJS == false ) // { // JQuery $.getScript( '/inc/extjs/ext-all.js' , function (data, textStatus){ if (textStatus == 'success' ) { _isLoadedExtJS = true ; Ext.state.Manager.setProvider( new Ext.state.CookieProvider({ path: "/" , expires: new Date( new Date().getTime()+(1000*60*60*24*30)) })); Ext.QuickTips.init(); // callback(); } }); } else { callback(); } } * This source code was highlighted with Source Code Highlighter .
Ext.BLANK_IMAGE_URL = '/inc/extjs/resources/images/default/s.gif' ; Ext.enableGarbageCollector = true ; // _isLoadedExtJS = false ; function _loadExtJS_andRun(callback) { if (_isLoadedExtJS == false ) // { // JQuery $.getScript( '/inc/extjs/ext-all.js' , function (data, textStatus){ if (textStatus == 'success' ) { _isLoadedExtJS = true ; Ext.state.Manager.setProvider( new Ext.state.CookieProvider({ path: "/" , expires: new Date( new Date().getTime()+(1000*60*60*24*30)) })); Ext.QuickTips.init(); // callback(); } }); } else { callback(); } } * This source code was highlighted with Source Code Highlighter .
Ext.BLANK_IMAGE_URL = '/inc/extjs/resources/images/default/s.gif' ; Ext.enableGarbageCollector = true ; // _isLoadedExtJS = false ; function _loadExtJS_andRun(callback) { if (_isLoadedExtJS == false ) // { // JQuery $.getScript( '/inc/extjs/ext-all.js' , function (data, textStatus){ if (textStatus == 'success' ) { _isLoadedExtJS = true ; Ext.state.Manager.setProvider( new Ext.state.CookieProvider({ path: "/" , expires: new Date( new Date().getTime()+(1000*60*60*24*30)) })); Ext.QuickTips.init(); // callback(); } }); } else { callback(); } } * This source code was highlighted with Source Code Highlighter .
Ext.BLANK_IMAGE_URL = '/inc/extjs/resources/images/default/s.gif' ; Ext.enableGarbageCollector = true ; // _isLoadedExtJS = false ; function _loadExtJS_andRun(callback) { if (_isLoadedExtJS == false ) // { // JQuery $.getScript( '/inc/extjs/ext-all.js' , function (data, textStatus){ if (textStatus == 'success' ) { _isLoadedExtJS = true ; Ext.state.Manager.setProvider( new Ext.state.CookieProvider({ path: "/" , expires: new Date( new Date().getTime()+(1000*60*60*24*30)) })); Ext.QuickTips.init(); // callback(); } }); } else { callback(); } } * This source code was highlighted with Source Code Highlighter .
Ext.BLANK_IMAGE_URL = '/inc/extjs/resources/images/default/s.gif' ; Ext.enableGarbageCollector = true ; // _isLoadedExtJS = false ; function _loadExtJS_andRun(callback) { if (_isLoadedExtJS == false ) // { // JQuery $.getScript( '/inc/extjs/ext-all.js' , function (data, textStatus){ if (textStatus == 'success' ) { _isLoadedExtJS = true ; Ext.state.Manager.setProvider( new Ext.state.CookieProvider({ path: "/" , expires: new Date( new Date().getTime()+(1000*60*60*24*30)) })); Ext.QuickTips.init(); // callback(); } }); } else { callback(); } } * This source code was highlighted with Source Code Highlighter .
Ext.BLANK_IMAGE_URL = '/inc/extjs/resources/images/default/s.gif' ; Ext.enableGarbageCollector = true ; // _isLoadedExtJS = false ; function _loadExtJS_andRun(callback) { if (_isLoadedExtJS == false ) // { // JQuery $.getScript( '/inc/extjs/ext-all.js' , function (data, textStatus){ if (textStatus == 'success' ) { _isLoadedExtJS = true ; Ext.state.Manager.setProvider( new Ext.state.CookieProvider({ path: "/" , expires: new Date( new Date().getTime()+(1000*60*60*24*30)) })); Ext.QuickTips.init(); // callback(); } }); } else { callback(); } } * This source code was highlighted with Source Code Highlighter .Ext.BLANK_IMAGE_URL = '/inc/extjs/resources/images/default/s.gif' ; Ext.enableGarbageCollector = true ; // _isLoadedExtJS = false ; function _loadExtJS_andRun(callback) { if (_isLoadedExtJS == false ) // { // JQuery $.getScript( '/inc/extjs/ext-all.js' , function (data, textStatus){ if (textStatus == 'success' ) { _isLoadedExtJS = true ; Ext.state.Manager.setProvider( new Ext.state.CookieProvider({ path: "/" , expires: new Date( new Date().getTime()+(1000*60*60*24*30)) })); Ext.QuickTips.init(); // callback(); } }); } else { callback(); } } * This source code was highlighted with Source Code Highlighter .
* This source code was highlighted with Source Code Highlighter .
- style = "cursor: pointer;"
- onclick = "javascript: void _loadExtJS_andRun (function () { Ext.Msg.alert ('Alert', 'Hello, World!');});"
- src = "inc / images / people.png"
- border = "0"
- alt = "Your Blog Tagline"
Source: https://habr.com/ru/post/52908/
All Articles