PDA

View Full Version : problem with require under chrome browser



Webtel
23 Nov 2011, 7:04 AM
i need to require some classes but want to include them in single request.

for that i created server action that concats and minifies files depending on class list provided in request.

everything works ok when i use firefox. but under chrome nothing happens though script tag is created in the head.


<script type="text/javascript" src="/ext/required?classes=%5B%22TS/view/devel/acl/RoleForm%22%2C%22TS/view/devel/acl/RoleGrid%22%2C%22TS/view/devel/acl/RuleForm%22%2C%22TS/view/devel/acl/RuleGrid%22%2C%22TS/view/devel/acl/ActionForm%22%2C%22TS/view/devel/acl/ActionGrid%22%2C%22TS/view/devel/acl/StructureForm%22%2C%22TS/view/devel/acl/StructureGrid%22%2C%22TS/view/devel/setup/Form%22%2C%22TS/view/devel/setup/Grid%22%2C%22TS/view/devel/setup/Panel%22%2C%22TS/view/devel/setup/Toolbar%22%5D&callback=%22function%20()%7B%5Cr%5Cn%5Ct%5Ct%5Ct%5Ct%2F%2FExt/create('TS/view/devel/PhpConsoleWindow')%3B%5Cr%5Cn%5Ct%5Ct%5Ct%5Ct%5Cr%5Cn%5Ct%5Ct%5Ct%5CtUtil/cmp('develpanel')/add(%7B%5Cr%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctxtype%3A'setuppanel'%5Cr%5Cn%5Ct%5Ct%5Ct%5Ct%7D%2C%7B%5Cr%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctxtype%3A'tabpanel'%2C%5Cr%5Cn%5Ct%5Ct%5Ct%5Ct%5Cttitle%3A'ACL'%2C%5Cr%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctitems%3A%5B%5Cr%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5CtFactory/layout/borderTab('Zasoby'%2C'aclaction')%2C%5Cr%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5CtFactory/layout/borderTab('Reg%5Cu00f3%5Cu0142y'%2C'aclrule')%2C%5Cr%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5CtFactory/layout/borderTab('Role'%2C'aclrole')%2C%5Cr%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5CtFactory/layout/borderTab('Struktura'%2C'aclstructure')%5Cr%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5D%5Cr%5Cn%5Ct%5Ct%5Ct%5Ct%7D)%5Cr%5Cn%5Ct%5Ct%5Ct%7D%22&never=mind.js?_dc=1322059700756"/>

output is ok under fire fox but under chrome i cant even see web requests.

ps after firefox requires that one file i explicitly require all the classes by names (but they are loaded at that time) - that s ok. why not under chrome ?

PS. I d use document....appendChild(SCIPT).. but again firefox works ok and chorm dosnt

mitchellsimoens
23 Nov 2011, 7:22 AM
Not an Ext JS issue. This is more for your server

Webtel
23 Nov 2011, 11:08 PM
Well. maybe it was just some coding issue. But i still need to know: What is the good way to require multiple classes in single request? (i need to fire callback after load);

would it be like i tired to do it :
Ext.require('/server/action&classes='+Ext.encode(classes_array), callback_fn_after_load)
[dont want dots in the url to be replaced with / and ".js" added in the end]

Or maybe rather:

Ext.getHead().appendChild({tag:'script',src:''/server/action&classes='+Ext.encode(classes_array)',CALLBACK:fn_after_load:});
[dont see any possibility to fire callback - except inclufing callback in the response that will be browser evald after load]

Or any better way to load a script and then to fire callback afterwards?