PDA

View Full Version : Ext.application works in all browsers except IE9



timbritton
8 Nov 2012, 6:31 PM
Hi,

I have a MVC Ext.application that works in Chrome, Firefox, Safari etc, but won't load in Internet Explorer 9. Though if a enable Developer Tools (F12) it will load. Any idea why this is happening? Or suggestions on how to debug what is happening?

Regards,
Tim

evant
8 Nov 2012, 6:55 PM
First thing to do would be to check for trailing commas.



Ext.define('Foo', {
foo: function(){
},

bar: function(){
},
});

timbritton
8 Nov 2012, 7:06 PM
Hi Evan,

That doesn't appear to be the problem.

A very simple app that doesn't work:



<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>AS3 to JS/Sencha Migration</title>
<link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css">
<script type="text/javascript" src="extjs/ext-all-dev.js"></script>
<script type="text/javascript" src="app.js"></script>
</head>
</html>




Ext.onReady(function()
{
var button = Ext.create("Ext.Button", {
text:"Click me",
renderTo: Ext.getBody()
});
button.addListener( "click", function(e) {
this.setText("Clicked");
});
});

Regards,
Tim

devnullable
8 Nov 2012, 8:16 PM
Sounds like you have console.log() call(s) somewhere? Those will fail if Developer Tools is not active.

If that is the reason you can add following to your app.js to comfort IE:


if (!window.console) window.console = {};
if (!window.console.log) window.console.log = function () { };

timbritton
8 Nov 2012, 8:47 PM
That's done it. Thank you very much.:D