Archive for May, 2009:

Adding DOM Event Handlers to the View

Download code
So, I have some functions that will add DOM elements to the page, allowing me to build a View. Now, to allow the user to interact with the View, I need to add event handlers to the DOM elements.
There are basically three ways of doing this, one for W3C-compliant browsers, one for Internet [...]

Comments (2)

Creating a Select Element that Plays Well with All Browsers

Download code
Creating DOM elements like text and password INPUTs, BUTTONs and TEXTAREAs is pretty simple. Creating a SELECT element, however, proved to be a little more tricky thanks to a quirk in the Opera browser.
Let’s look at a SELECT tag. It’s pretty simple, really. It has a SELECT tag with a number of [...]

Leave a Comment

Copying DOM Element Properties and Handling Browser Differences

Download code
I’ve made another slight, but significant, change to the way in which DOM elements are created by the View. Going back to my original approach of building DOM elements from HTML strings, it made sense to refer directly to HTML and CSS attributes. But now that I’m creating DOM elements directly through [...]

Leave a Comment

Refining the Creation of DOM Elements

Download code
If you recall from my first stab at creating the MVC View, I had a method of the View class called tag that would take some arguments and create a DOM element from them. This tag method would be called from higher-level methods designed to make creating a DOM element for the View [...]

Leave a Comment

Working out the Internet Explorer Bugs

I code on a Mac and test in Firefox during the majority of the development process. I do have a PC, sitting in the corner of my office, which I use to test code periodically to make sure everything also works in IE. (I also test Safari, Opera, Chrome and, if I’m feeling [...]

Comments (2)