views:

26

answers:

1

hey guys, i just wonder what's the better solution.

I have an iFrame with a google map on my website. the iframe has an id="map". I wonder now what's the better solution if I don't want the map to show if javascript is turned off.

should I have a

<noscript> <style type="text/css"> #map {display:none) </style> </noscript>

or can I wrap the whole iFrame inside of a iFrame to make sure it does just show up if js is turned on.

thank you for your advice!

+1  A: 

You can make display: none the default for the #map container. In the Javascript that is responsible for constructing the map, the first thing you do is to switch it to display: block.

But is this really necessary? Usually your #map container should only be an empty placeholder anyway, which simply won't get populated if Javascript is not available.

deceze