No it isn't. This replaces the image with a text node; run the code without the test image and you will see the distinct difference. You could also use the following code to degrade an image based menu into a completely text based menu.
PHP Code:
<script type="text/javascript">
// Try to load a small image
var testImage = new Image;
testImage.src = "testimage.jpg";
onload = function(){
if(!testImage.complete){
// If the image has not loaded the user has disabled images in the browser
// Find all of the images on the web page
var documentImages = document.getElementsByTagName("img");
for(var i=0; i<documentImages.length; i++){
// Create and insert a text node after the image using the image's alternate text
if(documentImages[i].className == "menu"){
var replacementText = document.createTextNode(documentImages[i].alt);
documentImages[i].parentNode.insertBefore(replacementText, documentImages[i]);
If images have been disabled the user will see the alt value, try it and see.
Anyone with images disabled will almost certainly have JavaScript disabled.
At least 98% of internet users' DNA is identical to that of chimpanzees
If images have been disabled the user will see the alt value, try it and see.
Anyone with images disabled will almost certainly have JavaScript disabled.
Yes I know they see the alt value but they also see a box around the image and a cross; I sometimes browse with Javascript enabled and images off, I'm sure other people do aswell, especially in low bandwidth environments; I would be interested in seeing any explicit proof that people with images disabled do not have Javascript enabled.
Bookmarks