Hiding elements that require JavaScript without JavaScript :: dade
This is clever: putting CSS inside a noscript
element to hide anything that requires JavaScript.
This is clever: putting CSS inside a noscript
element to hide anything that requires JavaScript.
Testing time with Tim.
Long story short, the NOSCRIPT intervention looks like a really great feature for users. More often than not it provides significant reduction in data usage, not to mention the reduction in CPU time—no small thing for the many, many people running affordable, low-powered devices.
Everything old is new again—sometimes the age-old technique of using a 1x1 pixel image to log requests is still the only way to get certain metrics.
While tracking pixels are far from a new idea, there are creative ways in which we can use them to collect data useful to developers. Once the data is gathered, we can begin to make much more informed decisions about how we work.
Now this is intriguing: putting your default images inside a noscript element, then do your viewport measuring and image-swapping before removing the noscript tags. But when I tried this a while back, I couldn’t get access to the noscript elements with JavaScript (which makes sense, when you think about it).
I wonder if it’s the use of class names or jQuery that allows it to work here?
Okay, you have to be a real JavaScript/HTML geek to find this funny but check this out: document.write('<noscript>...'); Madness!