Login Register

Dojo is undefined on Internet Explorer but working on Mozilla Firefox

Hi,

I have a script which work on Mozilla Firefox but not on Internet Explorer, I don't understand why !!
The code is here :



	
	Eagle
	
	
	
	

	
		var APPCLIENT_VIEW;
		var APPCLIENT_MODEL;
		
		dojo.registerModulePath('client','../../../../src/client');
		dojo.registerModulePath('fgl','../../../../lib/fr/fgl');
		dojo.require('client.application');

		dojo.addOnLoad(function() {
			APPCLIENT_MODEL = new client.applicationModel('./?mode=ajax');
			APPCLIENT_MODEL.initialize();
			
			APPCLIENT_VIEW = new client.applicationView(APPCLIENT_MODEL, dojo.byId('app'));
			APPCLIENT_VIEW.initialize();
			APPCLIENT_VIEW.show();
		});
	



	

With Debugbar tools, I have this message with Internet Explorer "Dojo is undefined" and the script block on "if((!this["console"])||(!console["firebug"])){..."

Is there any ideas ???
Thanks

the most common answer for

the most common answer for this behavior is a stray comma in your client/application.js file ... run it through jslint (jslint.com) and see if it warns you of about a trailing comma.

Oh thanks you , I didn't

Oh thanks you , I didn't known this web site.

I've try it, and actually I have many errors...
I correct them, and reply after.

Sorry for my enlish, I'm french...

be warned: jslint will

be warned: jslint will complain about a _LOT_ of stuff you probably do and know to work. you can ignore a lot of it. if it says ERROR on a line, its probably right, but if it just says "warning..." it's not an issue.

but be on the lookout for "training comma" ... that breaks IE + Safai iirc.

Trailing comma is the most

Trailing comma is the most common source of incompatibilities. Only FF supports it. The rest (IE, Opera, Safari) will barf with cryptic errors. Always try your code on these browsers to make sure you don't have any stray commas. Personally I do on IE + debugger, or on Opera (it has a decent error console).

I finished to correct my

I finished to correct my errors but I having the same result on Internet Explorer : Dojo is undefined !! grrrrr

I try to use dojo.js.uncompressed.js and DebugBar show this error :

Syntax error (line 47) : 
    if((!this["console"])||(!console["firebug"])){
        this.console = {};
    }

I try also to remove all contain in dojo.addOnLoad function, but without success...

I haven't any ideas to resolve my problem, thanks to help me.

I try to execute test fx

I try to execute test fx with Internet Explorer : /dojo/dojo/tests/fx.html

When I call directly this test, it's work with Internet Explorer. But if I call this test by apache server I have the error : "dojo is undefined"

Info : I don't use htaccess for restriction access...

Thanks

Try this simple test: 1.

Try this simple test:

1. comment out the contents of the dojo.addOnLoad function.

2. add to the dojo.addOnLoad function:

console.log('test');

3. comment out the two dojo.register lines and the dojo.require line.

Load the page from the apache server. If the console message prints, try moving the two register and one require lines inside the dojo.addOnLoad function, before the console.log line.

Load the page from the apache server. If the console message prints, uncomment the rest of the lines in dojo.addOnLoad, but ensure they are after the register/require lines and before the console.log line.

Load the page from the apache server. If the console message prints and your application runs without error messages, you are done (except for removing the console.log line).