| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| 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 |
|
#2
| |||
| |||
| sarmad.alsaiegh@googlemail.com 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 -- sm |
|
#3
| |||
| |||
| sarmad.alsaiegh@googlemail.com wrote: > 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. -- Steve Swift http://www.swiftys.org.uk/swifty.html http://www.ringers.org.uk |
|
#4
| |||
| |||
| Steve Swift a écrit : > sarmad.alsaiegh@googlemail.com wrote: >> 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. 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 ?) -- sm |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.