Categories
diary www

Ajax tabbed content that degrades gracefully without Javascript

Having no internet access at my new apartment has resulted in my being shockingly productive offline — writing, reading, and reworking bits of code that I might have a use for someday.

One of my recent obsessions has been with tabbed content. In my opinion, every page offering tabbed content simply MUST degrade gracefully without Javascript; there’s absolutely nothing worse than completely inaccessible content! For smaller, less complicated content panes, I’ve found this tabber script to be the best as the markup is very clean and minimal. In the absence of Javascript support, this method will simply show all content panes on the same page.

However, what I wanted was to have a dynamically loaded tabbed content page degrade to static tabbed content pages that still looked and functioned the same way. A web search led me to the Ajax Tabs Content script from Dynamic Drive. Without Javascript, it simply loads the content pane by itself in the browser window. I wanted it to load the pane from within the template of the original page, so I devised a method to accomplish this by using some PHP code.

All of the original features of the script are intact, including external css and javascript file support… but as with the original script, once loaded they’re there to stay through subsequent tab switches. I’ll have to see what I can do later about unloading those styles.

I also added cookies to the original script so that it now restores current tab content upon reload.

How it works should be pretty clear from looking at the demo source, and the PHP code is used in the same way that you would to handle any static menu and page templates: designate the currently selected item on the tabbed menu list, include the selected external source file in the content section, and add any associated stylesheets/javascript files to the header. To get the Javascript bit working, the link rel attributes should contain the content container id, and the rev attribute should contain a comma-separated list of the external files, source page first.

I suggest using mod_rewrite to rewrite the urls so that the links look pretty and ensure that all pages will get indexed by search engines.

Demo
Download demo source

Categories
diary San Francisco www

How to get around on public transit in San Francisco

San Francisco public transit trip planner
http://transit.511.org

Next Muni (real-time updates for popular bus/train lines)
http://nextmuni.com

Now all I need is a Sidekick…

Categories
diary www

Illness and the internet

Having been deathly ill with the dreaded sore throat / laryngitis / hacking-cough-preventing-sleep combination, and also having not been hard-core enough to obtain this season’s hottest super toy known affectionately as the “Wii!”, I have had ample time recently to re-discover the wonders of surfing the internet whilst consuming insane amounts of chicken noodle soup.

I am referring mostly to the web comic titled “The Perry Bible Fellowship” located at pbfcomics.com. Surely, you have heard of it! If not, you MUST check it out! It is guaranteed to help you through those miserable dark times of horrible illness.

I also briefly looked for online backup services and ended up sorting through a bunch of “best of” reviews only to find that many of those newfangled Web 2.0 companies no longer exist. It’s cool that everyone’s starting to give everything away for free, but it’s not cool when the free things disappear in a few months…

Anyway I am back home in Hawaii for the holidays, and I made it through the airplane ride here without my ears exploding! HOORAY! Hopefully the warm weather will speed up my recovery time.

Categories
diary www

Spam

Recently I’ve been getting daily doses of spam posts to my BBS (hey thanks, spammers). I finally got fed up and integrated captcha into the scripts… and sure enough, no spam so far. I’d prefer to use something like Akismet for this but the captcha was a quick hack for now.

Categories
diary music www

Warning to musicians: CdBaby’s Hostbaby service is a huge rip-off!

Hostbaby is CdBaby’s hosting service. They advertise it as “web hosting for musicians” on the CdBaby website, and it’s such a horrible service that I can’t bring myself to even provide a link to it from here.

Considering the free open source CMS (content management system) options out there, the fact that the whole point of a CMS once installed and setup is to allow users to do their own updates (meaning that CdBaby people spend little to no time doing any actual work on your site since the setup process is likely automated), and coupled with all the free hosting options out there, $20 a month for Hostbaby’s basic CMS (no e-commerce or video) and limited hosting plan is OUTRAGEOUS! I can’t believe a company whose supposed philosophy is to HELP small-time independent musicians make money from their music would turn around and overcharge them by so much! Yes, every musician and band should have a web presence. Granted, reliable hosting will cost a bit more than nothing. But charging $20 a month when MySpace is free (and has video too now, though many people still use YouTube) should be an indication that this pricing is way off! And $10 a year per domain is at cost? Yeah right!

It makes me even angrier when I think of CdBaby ripping off some poor unknown starving musician who automatically goes with HostBaby because s/he sees it advertised on CdBaby’s website, and doesn’t know of any other (fairly-priced) option. And CdBaby has that whole “indie” rep thing going on which makes them seem more trustworthy to such people, which in the realm of websites and hosting is totally false. Come on, Derek Sivers, don’t be a hypocrite and abuse your responsibility to help independents! Lower your hosting prices to a few bucks a month and give musicians your CMS for free. Or offer the CMS + hosting for free and do something else entirely for revenue, like integrating the CdBaby store into the e-commerce portion of the CMS.

Anyway, I recommend that all musicians out there just avoid this nasty Hostbaby thing entirely. If you’re looking for a professional website the best thing to do is to hire an independent to customize a website or content management system for you (which WILL cost you, but if you find the right person it will actually be worth it, and it will be CUSTOMIZED), and host it somewhere for really cheap (there are a billion hosting companies out there, many quite reliable, and hosting itself is just getting cheaper and cheaper). Honestly with the exposure and popularity of MySpace you’d actually even be WAY better off there than with some crappy Hostbaby CMS/generic template design, and as an added bonus you’d save all that money. Just keep your CDs on CdBaby to leverage their advertising/distribution channels (which is really what they’re good for), but link back to your website and also consider selling your CD direct on there using a cheap payment service like Paypal or Google Checkout for a price slightly less than CdBaby (since selling a CD on your personal site means you don’t pay CdBaby’s markup).

Categories
diary www

YouTube

I really love YouTube. I’ve mainly been watching music videos (they even have Japanese TV music programs) and more recently anime episodes. The quality isn’t the greatest but it’s bearable, and their streaming speed is decent (though not fast enough to stream longer videos continuously as it should). But of course the key here is accessibility and having such a massive collection all in one place.

But what I wonder is… how on earth are they making any money?

I really just don’t understand some business models…

Categories
diary web design www

Rounded corners with pure CSS

While searching for rounded corner implementations I came across a whole slew of methods and finally settled on this one:

Spiffy Corners – Making anti-aliased rounded corners with CSS

I like it because it works in most recent browsers, requires no images and no Javascript, and is pure CSS. The website also has a php code generator… input your color values and it will spit out CSS and html that you can just cut and paste! Very cool!