Showing an image to IE and non-JavaScript users

2 views
Skip to first unread message

Robert Kosara

unread,
Feb 15, 2010, 3:00:25 PM2/15/10
to prot...@googlegroups.com
Here's something I figured out on the weekend and thought somebody else might find it interesting. I wanted to have a simple way to show IE users and people who have turned off JavaScript (or are using a newsreader) an image instead of the live visualization. When you have JavaScript disabled, the noscript tag works, but IE thinks it knows JavaScript and will ignore that. So here's my solution. It's really simple, but I thought it was clever ;) I've tested this with and without JS on Safari, FireFox, and IE 6 and 8. I don't have IE 7, and I can't find a way to turn off JS in Chrome.

<!--[if !IE]><!-->
<script type="text/javascript+protovis"><!--
... Protovis code ...
// -->
</script>
<noscript>
<!--<![endif]-->
... Non-IE and non-JS content (i.e., image) here ...
<!--[if !IE]><!-->
</noscript>
<!--<![endif]-->

I did this for my iTunes 10 billion song downloads visualization here: http://eagereyes.org/applications/itunes-10-billion-song-downloads-visualization

Best,
Robert

Jamie Love

unread,
Feb 15, 2010, 5:09:03 PM2/15/10
to prot...@googlegroups.com
I like the graphs you've got there. Pretty.

--
You received this message because you are subscribed to the Google Groups "protovis" group.
To post to this group, send email to prot...@googlegroups.com.
To unsubscribe from this group, send email to protovis+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/protovis?hl=en.

Reply all
Reply to author
Forward
0 new messages