
Originally Posted by
Stomme poes
The only thing the fallback content can do is show up when the browser doesn't support CANVAS, whether JS is there or not.
Yer right, on that...

Originally Posted by
Stomme poes
<noscript> has no place on modern pages
Yes and no -- per script blocking is problematic, but that's why scripts should enhance content whenever possible, and if not use the DOM to attach your scripted content and remove/hide the non-scripted.
Which is actually what I did with my little canvas demo I wrote a year or two ago:
Code:
<div id="canvasHolder">This program requires the CANVAS element to function properly</div>
Code:
var cCanvas=document.createElement('canvas');
if (cCanvas.getContext) {
var container=document.getElementById('canvasHolder');
container.replaceChild(cCanvas,container.firstChild);
flat dom replace of the firstchild -- said firstchild naturally being the DIV's textnode. You could also do:
Code:
container.parentNode.replaceChild(cCanvas,container);
To replace the div with the new canvas element... just beware that container would be invalidated by that.
Either way, there's no reason for CANVAS to have a tag since it's useless without javascript... just like there's no reason it couldn't have simply been made a property object you could optionally attach to any element drawing over it's content... after all that's what an object model is FOR.
Bookmarks