javascript

Javascript: The Good Parts - book review

I banged through the new O'Reilly book by Douglas Crockford titled JavaScript: The Good Parts

Crockford is a very eminent programmer in the javascript community and I was excited to see a book come out by him. However, after reading it, I have to say it wasn't what I expected. I thought it was going to be a very detailed description of Javascript objects, and particularly JSON of which he developed and popularized. But what I found it to be was a description of what is good, bad and ugly about the language. Quite interesting for anyone who has used the language for any length of time, and would consider themselves adept in the language. At times I think I am adept, but I find when I begin to think that I get challenged to the point that I really don't know much at all.

Read more

Adobe Air SDK installation

adobe air
I downloaded the Adobe Air SDK so I could develop some Air applications, but once I downloaded it, I was at a loss of how to go about installing it. Adobe's instructions are missing from the package and nowhere to be found on their site. I have a PPC mac, so these instructions should work for those with that configuration. If you have an Intel mac, I am assuming this would work for that as well. It should also work for other *nix type operating systems.

Read more

2007 foxtrot

Is it just me or is a passing year sort of depressing. When I look back on 2007 I feel sad it is over. I had a good year. It was a rough year at times, but also a defining year for me. I took a new job, the first time I changed employment in 15 years. I started exercising more. I’m less than a year away from my 10th anniversary. I have a daughter in first grade who is a whiz that constantly amazes me. I have another one who should be in school because she is so smart, but missed the cutoff date.<!—break -->

Read more

Regex in javascript

I needed to create a toggle image in a menu. I decided to check the image src to see what image it was on. Regex in javascript to the rescue. Here is what I used to parse only the image name.

var re = /([\w\/\.\\:]*\/)([\w\.]*)/;
var imgSrc = $('toc').src;
var myArray = re.exec(imgSrc);
if (myArray[2] == "toc_open.png") {
$('toc').src = "images/toc.png";
}
else {
$('toc').src = "images/toc_open.png";
}

Read more

Setting nested DOM element attributes

I needed to set some attributes for some anchors in an iframe. I wanted them to open in the parent frame. The problem was I only wanted certain ones that were inside of certain elements. I wrote this javascript loop to find the <a> elements inside of the div with the id of "re".

Read more

Creative Commons License
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.
Permissions beyond the scope of this license may be available at www.bradrice.com.

RSS Feed  My RSS Feed