473,387 Members | 1,844 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Browser enable image

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
Sep 7 '08 #1
3 1146
SAM
sa*************@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
Sep 7 '08 #2
sa*************@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
Sep 8 '08 #3
SAM
Steve Swift a écrit :
sa*************@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
Sep 8 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: CJ Oxx | last post by:
I have a problem with browser charset recognition when using PHP 4.1.2 (this is the PHP version which our hosting company provides). For charset recognition, I use the following meta-tag: <meta...
4
by: Ben | last post by:
I have a page for my company that I need assistance with: http://www.eastex.net/ben/NewETN/subPage.htm When you resize the window (NS or IE) small enough that you have to scroll horizontally...
12
by: Kepler | last post by:
How do you get the height of the client browser in IE? Both document.body.clientHeight and document.body.offsetHeight return the height of the document. If the page is long and there's a vertical...
25
by: Ryan Stewart | last post by:
I'm working on a project to collect web application usage statistics. What are the recommended ways of detecting whether a browser is JavaScript enabled and/or capable? Obviously I can write a...
68
by: Steve | last post by:
Hi There, Prob a simple answer to this (I hope) but I can't quite work it out yet... I have this in a page: <map name="Map"> <area shape="rect" coords="43,68,52,77" href="map.html"...
10
by: Viken Karaguesian | last post by:
Hello everyone, Me again. Trying to learn some more :>) I hope I got the terminology right. How does a browser parse (correct term?) an HTML document. I'm sure that every browser does it a...
4
by: satish mullapudi | last post by:
Hi Gurus, I am using DB2 UDB 8.2.I want to load/insert images into DB2 database.So I found out we need to enable DB2 Image extender .How to enable that extender? Please tell the complete process...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.