Javascript and CSS, Making Pages Dynamic

I have always had a hate / dislike relationship with javascript.

I have never considered it reliable enough to use in websites, different browsers baulk at different things.

To my point, The company website I am working on at the moment needs a collapsing side structure, for the first time in a long time I used javascript with a style defined on each block with “display:none”, Mistake Number 1.

The other day I was viewing my test site remotely and i decided, lets try this out on my Pocket PC, i wonder what kind of javascript support it has !.

None.

So I got bored and basically set all the sidebars to “display:block” and then in an onload script (the .js file is generated by php) it closes the unused ones.

So in a Pocket PC Internet Explorer, it shows the menus fully deployed, in Firefox / PC IE it collapses the unused (deselected) menus.

HUZAAH !

Leave a Reply

You must be logged in to post a comment.