High Tech Sorcery

Web Development

Firefox seems to load content in noscript tags when javascript is enabled

by on Apr.07, 2011, under Web Development

I can’t find any information about this, partially due to the badly named noscript extension, but it appears that firefox will load an image in a noscript block even when javascript is enabled.  This is troubling for my use because I’ve put a static google map on an app for those that do not have javascript and wrapped it in a noscript to avoid loading it when it’s not needed.  Now javascript users have to download the map twice, once static, once dynamic.  Definitely a waste. Maybe this is fixed in firefox 4.

2 Comments more...

xAuth as an alternative to OAuth

by on Jun.01, 2010, under Web Development

In doing some work with OAuth today I cam across xAuth which is apparently supported by Twitter.  Good thing to be aware of:

Leave a Comment more...

Resources for working with ICalendar, Ruby, and Rails

by on Mar.25, 2010, under Ruby On Rails, Web Development

Icalendar is not fun to work with. If only there was a library that would make it easy and pleasant. Alas, that does not seem to be the case, but there are places to start.

There are 3 ICalendar libraries available as gems:

Beyond that I’d say anyone planning to work with ICalendar files should be prepared to dig into the reference.  I found iCalendar Specification Excerpts particularly useful.

1 Comment more...

Hiding elements when javascript is enabled

by on Feb.17, 2010, under Web Development

I was cleaning up some javascript notifications for a website and came across this common question: what is the best way for elements to be visible when a user does not have javascript enabled but hidden when they do (often to be revealed by javascript?

I cam across an article titled How To Hide And Show Initial Content, Depending On Whether JavaScript Support Is Available which was great reading on the subject.  There were 3 methods that stood out in the article and comments.

  1. Use a javascript file sourced in the head section to include a css stylesheet file specifically for javascript enabled browsers.  The downsides of this method are 2 extra requests on the initial visit and needing to keep all javascript css in a separate css file.
  2. A method detailed in The best way to hide content by JavaScript is to attach a class to the html element.  This is a violation of the spec and therefore may not be cross browser compatible but seems to be used by a number of people without problem.
  3. By adding a 1 line script immediately after the body tag that sets the body class to “js” or something else indicating the presence of javascript.  The chief objection to this is that setting the body class could trigger a re-rendering.

At the moment I’m trying option 3.  My reasoning is that it is the most simple to implement and maintain.  The concern that it could cause a re-rendering seems minimal to me.  Presumably since the parser proceeds linearly through the html than this change should occur before much else and thus not lead to any visible flicker.  However, real world testing may be the only way to discern if any of these methods are superior to the others.

Leave a Comment more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Blogroll

A few highly recommended websites...