Catching Android’s Back Button in PhoneGap

This little bit of code is going to be useful to those of you developing a “singe page” app inside of PhoneGap. This applies to Sencha Touch (big fan), but doesn’t as much to jQuery mobile and jQTouch, as it’s a multi-page/navigation based event framework (it uses the app’s url string to do things like …

Mobile Platform Detection on the web

I had a use case recently where I need to determine whether the client browser was a desktop/laptop/etc or a mobile device that supports tap events in JS. This will be useful to people who are dynamically binding different events to elements. var tmpElem = document.createElement(‘div’); tmpElem.setAttribute(‘tap’, ‘return;’); clickEvent = (typeof tmpElem.tap == “undefined”) ? …

ReadOnly Form Elements

Here’s a quick note for the frustrated: When setting the readonly parameter on a form element via javascript, make sure you use a capital “O” as follows: elem = document.getElementById(‘myInputElement’); elem.readOnly = true; Why it took me so long to find that out, I have no idea why. Most forums threads by others seem to …

Dynamically set onClick events in IE and Firefox

I’ve had a couple of small tasks where I’ve needed to toggle the onclick events on a page element. It was surprising how difficult it is to get a straight answer on how to do this. function hide_field() { my_element.onclick = function() { show_field(); }; } function show_field() { my_element.onclick = function() { hide_field(); }; …

Cool Download Page

I’m looking into new JS frameworks for frontend enhancements, and came across MooTools on recommendation from a friend. The framework has lots of cool features and seems pretty simple, but one thing I’m most impressed with is the download page. It acts just like the *nix package managers – allowing to you pick and choose …

Pre-QA isn’t good for interviews

I’m just going to throw this out there… if you have a piece of software, site, etc that isn’t quite at the QA stages, no matter how rockin’ in might be, you might want to consider holding off on showing it to others until you know the demo is going to work. I think I’m …

Mr. Fish Lite is coming

If you’re interested in the DFL project, you’ll be happy to know that German and I are tasked with a bit of a crack programming job in the next week or so. Actually, we told our boss the idea we had about making a “Lite” version of the data viewer program that runs through some …

Hey there! Come check out all-new content at my new mistercameron.com!