PDA

View Full Version : dynamically inserted script tags and Ext.onReady



bartvde
25 Nov 2007, 11:34 PM
Can Ext.onReady deal with dynamically inserted script tags? Ext.onReady is called before the dynamically inserted scripts are loaded. Is there a way around this?



var s = document.createElement("script");
s.type = 'text/javascript';
s.src = "lib/mfbase/mapfish/locale/mapfish-lang-"+language+".js";
document.getElementsByTagName("head")[0].appendChild(s);

mxu
26 Nov 2007, 1:11 AM
Ext.Element.
var el = Ext.get('el-id');
try{
el.update(htmlContent-with-js, true);
...
}catch(e){

..
}

this will render html contents and activate js.

mxu