Forum Moderators: open
Sorry for my english. I'm from Ukraine and know english language at low level...
I have one little problem.
How I can detect Graphics On/Off option in browser settings?
I need to make web-site, which opens the non-graphics page first time and check graphics on/off mode. Afterward if graphics is on in browser settings, script must redirect user to a graphical variant of web-page.
Please, help...
Thank you in advance
var testImages = new Image();
testImages.src = "1x1px.gif";
if( testImages.width == 0 )
{
// Images are not being loaded
}
Again, I don't know if that works for all browsers or how reliable it is.
Your script code lets me create a new, more intelligent script.
So, look at this:
...
<script language="javascript">
function check_graphics_mode()
{
if(check_img.complete) {... re-direct page ...};
}
</script>
...
<body onLoad="check_graphics_mode()">
<img src="1x1_transparent.png" name="check_img">
....
</body>
...
More simple, more intelligent I mean..
What do you think about it?
<script language="javascript">function check_graphics_mode()
{
if(check_img.complete) {... re-direct page ...};
}</script>
...
<body onLoad="check_graphics_mode()">
<img src="1x1_transparent.png" name="check_img">
More simple, more intelligent I mean..
What do you think about it?
Actually, I prefer my method. The reason being that this method requires that you have some image rendered, even if it does nothing. You then have to account for this image in all of your page flows. It's more intrusive because you now rely on some external content from the script, whereas my method does not actually need to render the image and doesn't affect any of the other flow of the document.