web(cslai)

Findings and Notes in Web Development

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. :D

No Comments

No comments so far.

Leave Message

Personal Details

Toggle Extra

© 如无特别著名,本站的所有著作权归作者Jeffrey04以署名-非商业性使用-相同方式共享许可证发布。

本网志是由Wordpress荣誉呈现,站点界面SimKite设计归设计者Jeffrey04所有。

由于本站采用即时刊登留言者的留言,所以无法也不能完全监察所有的留言,站长Jeffrey04保留删除和不删除留言之权力。欢迎网友发表具建设性,负责任兼且合法之言论,否则已经发现立即删除而不另行通知。倘若网友发现留言出现问题请留言提出,本站保留一切法律权力。