Browser enable image

  • Thread starter sarmad.alsaiegh
  • Start date
S

sarmad.alsaiegh

hi all,
i need ur help pls.
how can i detect the client browser setting with javascript. example:
the client browser blocked Popups. this example i could solve it, but
what i need is right now, how can i know if the browser of the client
are enable images to display.

if u dont understand my question, pls tell me and i will describe it
again.
thanks and i hope for answer.

best wishes,
sarmad
 
S

SAM

(e-mail address removed) a écrit :
how can i know if the browser of the client
are enable images to display.

I don't know.
Why that for ? (what about accessibility ?)

<html>
<script type="text/javascript">
var imags = false;
window.onload = function() {
alert('images accepted ? '+imags);
}
</script>
<img src="image_test.gif" alt="text images" onload="imags=true;">
</html>


Seems to work in my Fx,
(even with images blocker (Estension: Web Developer) --> false)
and also : Safari, Opera and IE.6-standalone
 
S

Steve Swift

how can i know if the browser of the client are enable images to
display.

The only mechanism I can think of is to run some JavaScript at the
beginning of the page load (inline, near the start of the HTML) that
stores the time, and then again in the onLoad event where it subtracts
the load time from the current time. Include an image which is huge,
but preferrably invisible.

If the page takes a long time to load, then presumably the browser
downloaded the image, so has images enabled.

This approach has so many flaws that I don't have the time to list them.
 
S

SAM

Steve Swift a écrit :
The only mechanism I can think of is to run some JavaScript at the
beginning of the page load (inline, near the start of the HTML) that
stores the time, and then again in the onLoad event where it subtracts
the load time from the current time. Include an image which is huge,
but preferrably invisible.

I think we have not to wait downloading time since compliant graphical
browsers wait all images are loaded before to launch the JS 'onload'
attributed to the body tag.
If the page takes a long time to load, then presumably the browser
downloaded the image, so has images enabled.

You can also use an 'onload' in a transparent very small image to toggle
a variable defined previously in the head.
This approach has so many flaws that I don't have the time to list them.

See my code given in my previous post.

Tested on my browsers, it seems to work (except in IE Mac which launches
the body onload before loading images) but I don't know what that could
give in a text browser ?
(do text browsers use JS ? if yes, what that can give with dhtml ?)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top