April 14, 2006 | Web Design & Development
Then I went on to tackle the fact that Safari’s form labels don’t act like form labels in the other browsers – they don’t bring focus to their associated form element when clicked. Seems like a minor issue, but when you really think about form usability it is nice to be able to click on the name of an element to select it and not always have to hit the element itself. This is particularly handy for radio buttons and checkboxes.
Read on to find out how I finally caught up to last year.
Update: Now that I go browsing through old code to reuse something I’ve found that my little piece of borrowed code is actually something that is less than what I’ve been using for some time, but had just forgotten about.
I feel so behind
So, its now 2006 and I have what I think is a firm grasp on AJAX (xmlHttpRequest). First made popular by a Google experiment and then taken to the extreme by the popular web crowd, Ajax has become a staple of web application functionality. You can’t turn a corner on the internet anymore without hitting something Ajax. Well, you can, but chances are those pages suck. 😉
My first attempt at JS OOP was a miserable failure as I thought I could apply the same principals to JS as I did PHP – this was only half true as my first class had a myriad of problems, none more odd than my private variables becoming public and my public variables not being found at all. So very odd.
But after reading as much as I could I think I finally got my head around it. I’m not going to try and give a primer here as I don’t think I’d do a very good job of explaining it. I’ll just point to what I accomplished.
Here is a page that shows the script in action, very dull action, but that also shows the source in the page for easy viewing.
This also marked my debut into a much more elaborate commenting scheme that is being driven by the Pear PHP project. Details can be found here. It has certainly improved the consistency of my documentation, even if I’m not following the scheme to the letter.
Safari: Like a red headed stepchild
Ok, not really.
But I did finally got fed up with Safari acting different than the rest of the browser crowd as I’m really engrossed in forms right now due to a large project that I’m cranking out. Making sure the forms acted properly across all browsers was a key point to this project so bringing Safari back into the room with the other major browsers was a personal vendetta of sorts. Yeah, I know, IE is the devil when it comes to non-conformance but this little issue was one that had to finally be addressed.
It is basically a shortcut to getting an element by id so it is now possible to use $(‘myObj’) to access an object on the page.
Update: As it turns out, this little tidbit is something that I’ve been doing for some time, but at the time stole it from somebody else **cough** john **cough** but had forgotten about.
I’ve been using this for what seems like forever:
// older versions of IE will respond to this
var isOldBrowser = document.all ? true : false;
// old, icky
// DOM enabled, yummy
So, yeah, I guess I didn’t find anything groundbreaking, unless my failing memory qualifies.
Ok, I’ll shut up with my behind the times crap now