Entries in the ‘Development’ Category:

Adding Event Handling to JavaScript Classes

Download code
The next item I need to address is object events. I have a mechanism for attaching event handlers to DOM objects, so when the user clicks a button, or changes the value of a text box, or does some other interaction with a DOM element, the View can handle that event. But [...]

Leave a Comment

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