EM’s are best for text, PX for pixels. This is because fonts are drawn with vectors, images are drawn with pixels… Usually it’s better to have the text resize and images not, becuase the auto-resizing in browsers usually looks like something you’d scrape off your shoe.
As to javascript, it has nothing to do with it, though it CAN enhance selective width layouts (what was called mcSwitchy for a while) it’s been supplanted in that role by “media queries” and min/max-width. So for things like that, forget javascript unless you REALLY need it supported in legacy IE… at this point I’m just feeding them a crappy fixed width and letting everyone-else get fluid or semi-fluid layout… though again, that has nothing to do with font-size.
The best websites are what’s called ‘fluid’ – they adjust as needed to the screen size. “semi-fluid” means a fluid layout that adjusts between two widths, and is what for the most part I’m designing these days. Truly 100% fluid can result in lines of text ending up too long for some people to keep track of, and while I’m not afflicted by this (give it enough line-height, it’s fine), I do try to keep in mind the people who are. Typically my “screen/tv/projection” pages are fluid between 752px (min-width) and 70em (max-width), giving IE6/lower users (who know not the min-width) the 752 fixed so the layout at least works.
In any case, it comes down to adjusting to the default size the client wants for text, not what some artsy fartsy designer thinks is perfect on their perfect mix of default font size and whatever resolution they happened to choose to draw their pretty picture.
Again, the default font size in browsers is NOT always “16px” no matter how much people try to tell you it is. In Windows V or 7, go into “display” from the control panel, which is also listed under “personalization” in the “see also” part at the bottom right. It will say “make it easier to read what’s on your screen” with the choices of:
smaller - 100% (default)
medium - 125%
larger - 150%
Those first two correspond to the old Windows 3.0 through XP font settings (display properties -> settings -> advanced -> general -> dpi setting, not appearance -> font size!) of small fonts (96dpi) and large fonts (120dpi) – which of course makes win7 ‘larger’ work out to 144dpi. You can also set ANY custom dpi you want scaling it up to 200%.
Browsers SHOULD obey this – IE7 and lower use it directly on %/em rescaling nothing else, as does Opera. IE8 and newer uses this as the default zoom, though you can go in and change it back to the old behavior (which many do). Gecko and webkit browsers like a bunch of sweetly retarded crack babies go “system metric, what’s that?” and ignore it, though you CAN go in and manually change it.
This is supposed to be an OS and device specific setting, NOT a browser one – simply something browsers SHOULD pay attention to, and in this day and age is the real reason to use it – so large font users don’t have to even TOUCH “zoom” or “text-resize” in ANY application, page, etc… as it’s handled for you automatically OS wide.
Though admittedly, this is a concept that other Operating systems usually fail miserably at even TRYING to do, as applications generally aren’t written to even check for it. Just ANOTHER reason I consider anything other than Windows a tinkertoy as a desktop OS.