Widget works in Firefox, not in IE

1
I've written a very simple About box widget, it's basically the same as the Hello World one in the docs but just has a few extra properties that it formats togther into a message about the application's version number, revision number, release date and so on. It works perfectly well in Firefox, but when I try to open the about box in Internet Explorer it displays the following instead of the about box content: Error when loading url PipsAndSubbies/about.mxf: Could not load class 'AboutDialog.AboutDialogWidget.AboutDialogWidget'. Did you spell the name correctly and use a full path, like 'dijit.form.Button'? Here's the js file: dojo.provide("AboutDialog.AboutDialogWidget.AboutDialogWidget"); mendix.widget.declare("AboutDialog.AboutDialogWidget.AboutDialogWidget",{ addons : null, inputargs : { name : '', version : '', revision : 0, date : '', }, postCreate : function(){ this.writeMessage(); this.actRendered(); }, writeMessage : function(){ this.domNode.innerHTML = '<p><b>' + this.name + '</b></p>' + '<p>Version ' + this.version + '</p>' + '<p>Revision ' + this.revision + '</p>' + '<p>Date ' + this.date + '</p>'; }, uninitialize : function(){ } });
asked
2 answers
5

probably a little syntax error and one browser being more strict as the other.

I don't have the opportunity to try to reproduce your problem, bur first thing i noticed is that the 'comma' behind

date     :  ''

in the inputargs array is redundant.

answered
3

Indeed, Internet explorer does not allow for 'unused' comma's. To recognize those faster you could use this style common by JS developers (altough i hardly use it). :

  inputargs  : {
         name     :  ''
   ,     version  :  ''
   ,     revision : 0
   ,     date     :  ''
   }

A decent IDE also recognizes this kind of errors. Both Komodo Edit and Aptana (Eclipse based) are freely available. I almost always use the first one.

answered