473,593 Members | 2,858 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1152
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=t rue;">
</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
6187
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 http-equiv="Content-Type" content="text/html; charset=UTF-8"> Here is what I have tried so far: - Regular html page: charset is properly recognised - PHP page which just prints out the html: charset is not properly recognised (ISO charset is...
4
2866
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 (because of logo image), scrolling right breaks the layout. I'm using 100% div widths, and these apparently don't reset when scrolling. I tried using a min-width and IE hack for min-width ( width:expression(document.body.clientWidth < 550 ? "450px"...
12
10146
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 scrollbar, you get the height of the entire document, screwing up any chance of centering a window in the browser using these values. Is there a way to get the height of the actual browser window and not the entire page height? Thanks.
25
2886
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 script to invoke something on the server, and if it works, then it works. Is there a better way? I'm looking for the least intrusive way of doing it, from a web application point of view. i.e. I'd like to be able to drop this into an existing...
68
11149
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" target="_blank" alt="Link to map"> </map>
10
4884
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 little differently. Do they simply just read a document top-to-bottom and left-to-right and just display elements in the order in which they encounter them? Or, do they give priority to certain types of content? For instance, would a browser
4
2766
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 to enable that Db2 Image Extender & the following steps to insert images into the database. Please Help me out...........
0
7935
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8236
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8366
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7995
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8227
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3851
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3893
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1467
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.