Notes on codes, projects and everything

Working Life

I didn’t realize that I have been working for 3 weeks until the Labour Day which was a public holiday. Many things happened in these few weeks and I am still struggling to catch up with it. My superior and colleagues have been very helpful and offered me some helpful tutorials and books. I was instructed to build a event scheduler application using codeigniter in the first week and then work on a side project that extends a form using DOM methods and properties.

Developing the scheduler was not too difficult as I do not have to deal with browser experience inconsistencies very much and only concentrate on the business logic. However, when I started on my second project that extends a form to provide various widgets to guide users in filling the form correctly using YUI I nearly killed myself due to frustration. I am developing my scripts in a Ubuntu Gutsy Gibbon 7.10 desktop and use firefox 3 beta 4 to test them. I finally managed to produce a workable prototype in a week that runs almost perfectly under firefox.

Nightmare comes when the same script is deployed to a windows machine with the major 4 browsers installed (firefox, safari, opera and internet explorer). All browsers except IE7 runs my script and the error message offered by IE7 has no meaning. The first problem encountered was with the select box creation through DOM. As suggested by a tutorial in w3school, I used the following code to create the selection box.

var y=document.createElement('option');
y.text='Kiwi'
var x=document.getElementById("mySelect");
try {
x.add(y,null); // standards compliant
}
catch(ex) {
x.add(y); // IE only
}

Internet Explorer was not giving any helpful error message telling me which part is not right and I would have to use the following code to achieve the same thing.

x.options.add(new Option(...))

The reference of the constructor parameters to instantiate an Option object can be found here.

There are a couple of other problems too but fortunately I managed to fixed it in time. Internet Explorer is very strict with DOM but the problem with it is that the error message it spits is often far from being helpful. How the hell can one find out what can possibly be the cause of a “random runtime error”?

Recently I started to learn how to code using VIM through CREAM and vimtutor. I am now in the progress of remembering the key commands and probably uninstall cream by the end of the week to fully switch to VIM. I used to code in a mini-emacs editor provided by swi-prolog when I was doing my prolog subject but I didn’t quite like it because I don’t have a very flexible fingers to press the modifier keys all the time. 😀

leave your comment

name is required

email is required

have a blog?

This blog uses scripts to assist and automate comment moderation, and the author of this blog post does not hold responsibility in the content of posted comments. Please note that activities such as flaming, ungrounded accusations as well as spamming will not be entertained.

Click to change color scheme