Here I am busting my ass fixing code, again :). A few weeks ago I knew nothing about Dojo now I feel I know more than the person that wrote the code I was debugging. It's hard stuff to look at code see what the programmer is
trying to do and fix their code so it does what they
intended it to do. As I mentioned in an earlier post, while it is frusterating (to me at least) I do believe debugging some else's code is the
best way to learn. It helps that my guy knew what he was doing, so his bugs are not easy and he provides some good code inspiration on what he was trying to attempt.
On to the point. The website we were working on utilizes a dijit
(a dijit is pre-built Dojo functionality like a javascript calendar or javascript accordion that you can use on your website by just plugging in a few key parameters to be off and running) accordion widget. It was displaying incorrectly in IE8. Turns out the problem was a combination of several things one of which he was trying to embed html in the title attribute of the accordion pane. Dojo uses the title attribute to make the header of one division of the accordion. This accordion header is where the user clicks to display the text associated with that header.
The mistake was to embed the html in the title attribute. What I came to learn was dijit provides a wonderful
themes folder in it is a dijit.css class file which allows you to decorate with CSS all the widgets Dojo makes. After I removed all his markup from the title attribute for the accordion and removed a "display:block" from the special dijit.css file in the themes folder, the accordion works as intended in IE8.
The lesson I learned here is dijit has it's own CSS in which you can customize the look and feel of their widgets to the smallest level, however don't try to change dijit's widget rouge style. It will only cause you time lost and heart ache because the dijit may not work as intended.