Debugging JavaScript

I am going through my JavaScript textbook for the first time. You just can't read the chapter. You need to work through the big example that is presented. That means a lot of typing in code. Get this. The code from my textbook is buggy.

Now I am learning a great deal just by debugging the code. However this is a painful process. JavaScript is case sensitive. So if you declare a variable with one spelling, you cannot expect the use of a different spelling somewhere else in the code to work. I keep relearning this fact the hard way.

My new technique is to cut and paste variable names in my code. It seems to be helping. I will say this. The examples in the book text are some nifty looking web pages. They are very clean and crisp. The exercises at the end of each chapter are decent but still somewhat lacking. Maybe I will have to sign up for a college course on JavaScript after all.

Event Handlers Not Firing

I am home spending a week to get ahead in my JavaScript learning. Was just finishing up some case projects at the end of the chapter. I ran into a problem that I glossed over before. Sometimes the event handlers just don't seem to be firing. This is very frustrating.

I could not get the onclick event handler to work for the image buttons on a form. This could not be right. I finally googled around and found that old Netscape 4 did not handler event handlers for this element.

But I am running Internet Explorer 6. I would hope it could handler these onClick events. Nevertheless, I followed the advice on what to do if you are running Netscape 4. I dropped the image button for a regular image element nested in an anchor tag. The anchor handles the onClick event.

Yeah this is a hack, but I am getting desperate. Props go out to Web Developer Notes that pointed out the Netscape 4 work around. Thank you very much,

Fragile JavaScript

I purchased a textbook on JavaScript and am trying to learn the language on my own. So far I have read up on variables, functions, and events. I do all the exercised at the end of each chapter. Here is the thing that irks me. If you have one character in your source code wrong, the resulting JavaScript just does not work.

At least in HTML when things go wrong, the browser seems to display something. With JavaScript you just get an empty page. I've got to discover or invent a way to make my JavaScript coding more robust. It feels like the whole house will come down if you make a change to your code or try something new.

Cascading Style Sheets 3

Lately HTML5 has been getting all the buzz. But Cascading Style Sheets 3 (CSS3) is also coming out. It allows you to easily do buttons with rounded corners. You specify this with the border-radius property.

You should also not count out JavaScript. The future is most likely going to be a combination of HTML5, CSS3, and JavaScript. I know I am learning JavaScript to be ready for the new web wave.

Microsoft Expression Studio

The instructor of my XHTML class told us to download Adobe Dreamweaver to do HTML pages quickly. Adobe has a 30 day trial that anybody can. Well I got the program installed. The user interface does not look intuitively obvious.

Then my instructor said he could give us Microsoft Expression Studio free of charge. He made us install it in the computer lab. While it might not do as much as Adobe Dreamweaver, it is surprisingly easy to use.

After knocking out web pages with Express Studio, I wondered if it was worth it to learn how to hand code HTML pages. The verdict is yes. You will know how to debug any problem you encounter. You will also understand the setting much better than somebody who started by pointing and clicking.

Web Developers

I checked out this graphic today comparing web designers and web developers. The most striking difference was the average salaries. Designers make around $47k, while developers pull in $85k. Now why would anyone choose to be a design with statistics like that?

One common feature between the two is that neither job will get you props with the ladies. That is just too bad. Personally I want to be more than just a web developer. And I also want to earn more than the average $85k. So I need to step up my game and learn databases as well.

HTML Text Area

I am learning about HTML forms right now. The final control I was placing on my form was a textarea. The thing was supposed to be about 3 rows tall. However when I displayed my form in the browser, there were scroll bar controls on the right side. But there was not even any text in the textarea. I searched without sucess for some type of attribute to set in order to remove these scrollbar controls.

There had to be a way to have a plain textarea without any scrollbar controls. I figured it out eventually. You got to display your web page in the FireFox browser instead of Internet Explorer.