PDA

View Full Version : Application Load Error



tdikarim
7 Jun 2013, 1:37 AM
Hi All,

Extjs 4.1.1

I have an application that work fine on Windows client browser(Mozilla) but not on linux client (also Mozilla).
My problem is for example the file Json.js is not loaded (and all other files contained in src folder)

In Firebug the response for this file loading is empty and I have an error on line 5656 ext-debug.js.
xhr.open('GET', noCacheUrl, false);

Do you have some idea ?

Thanks

tdikarim
8 Jun 2013, 2:28 PM
Hi,
How can I Workaround for CrossDomain ?

Thx

slemmon
10 Jun 2013, 11:39 AM
Check out this thread talking about making requests cross-domain using Ext.Ajax (or classes using Ext.Ajax).
http://www.sencha.com/forum/showthread.php?192338

For server-side you might check out:
http://enable-cors.org/

tdikarim
11 Jun 2013, 11:35 AM
Hi Slemmon,

Thanks to give me some time.

I have try this :
I have add to my index.php that load the application :


<?php header("Access-Control-Allow-Origin: *"); ?>


that doesn't resolve this issue.

All my js files that I have defined is loaded successfully like :


...

<?php print "<script type=\"text/javascript\" src=\"" . "../../" . _FILE_PARAMETRE_ . "\"></script>"; ?>

<?php print "<script type=\"text/javascript\" src=\"" . _CURRENT_VERSION_LIBRAIRIE_ . "ext.js\"></script>"; ?>

<?php print "<script type=\"text/javascript\" src=\"" . "../../" . _FILE_DEFINE_GRID_ . "\"></script>"; ?>

...

The ext.js is loaded successfully

BUT the files loaded by the ext.js are Not loaded. in firebug the response result is empty and display an error in the console on the loadScriptFile function on the xhr.open command without additional information.

Does exist another way for load file library contained in the ext.js ?

Without that my application cannot be deployed
Thanks for your help

Karim

slemmon
11 Jun 2013, 2:53 PM
What about if you use ext-all.js as your library file? Or you might build your app using Sencha Cmd (since that concatenates all required files into one) and see if that resolves the issues you're seeing.

tdikarim
11 Jun 2013, 11:07 PM
Hi,

I Will try with Sencha cmd.

Could you tell me if I am wrong...
All the files loaded by the LoadScriptFile function contained in the ext.js are the files defined in my require list ?
like by example :


Ext.require([
'Ext.Viewport',
'Ext.data.JsonStore',
'Ext.data.Store',

...

'Ext.ux.form.field.ToggleSlide',
'Ext.ux.toggleslide.Thumb'

]);


Thanks

slemmon
12 Jun 2013, 2:22 PM
Sorry, I'm not sure I follow the question.

tdikarim
2 Jul 2013, 6:08 AM
Hi slemmon,

sorry for my late response

That work fine now. I'm using this

on the server


<?php header("Access-Control-Allow-Origin: *"); ?>
<?php header("Access-Control-Allow-Methods: POST, GET, OPTIONS"); ?>


use ext-all.js

and Ext.Ajax.useDefaultXhrHeader = false;

Thanks for your help