PDA

View Full Version : load and unload javascript dynamically



jodimas
14 Oct 2010, 5:23 AM
Hi,

Is there in Sencha a possibility to load and unload javascript dynamically like here:

http://www.codeweblog.com/dynamic-js-loader-dynamic-invocation-of-external-js-file/

I have tried it but i always get this error after loading a scriptfile:

TypeError: Result of expression 'function(obj){ obj.setJSStatus(file,true,path); }.createDelegate' [undefined] is not a function.

evant
14 Oct 2010, 5:56 AM
The createDelegate function was moved off the function prototype, so



// old
f.createDelegate

// new
Ext.createDelegate(f);

gabrielstuff
14 Oct 2010, 9:16 AM
Is this a way to speed up loading app ?

jodimas
14 Oct 2010, 10:35 PM
Yes one reason is to speed up loading the app.

The other reason is to load and unload pieces of the code with big images on demand and, cause the memory cache on the ipad and iphone is something about 5MB (i'm not sure) , and when you exceed it the safari crashes.