programming

languages

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 pocket guide is now a free download

Ajaxian had an interesting post. O'Reilly has released the Adobe Air Pocket Guide as a free download. You can get it here.

Air Pocket Guide

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