b3ta.com board
You are not logged in. Login or Signup
Home » Messageboard » XXX » Message 5650620 (Thread)

# not as simple as it sounds!
you need to identify the browser accessing the page hosting the image; this can be done with server side code and testing the HTTP user agent, or by client side code (JavaScript)

the javascript route may be easiest and is probably the more dependable way of doing things

have a squizz here for browser detection scripts

you can test what the browser SAYS it is (some browsers can spoof and pretend to be others) using app.name or test things like the DOM (document object model) properties - these are implemented differently between browsers)

you can then use an if..then..else constuct to document.write the correct code to the page depending on your if..then (assuming javascript is actually turned on)
(, Sun 12 Feb 2006, 22:10, archived)
# cool, cheers
I shall have a try
(, Sun 12 Feb 2006, 22:17, archived)
# but that`ll only work if the image is displayed on a HTML page
you can`t really do it if e.g. the image was going to be posted here

in that case you`d need to <img src="...."> to a script on your server that generates / returns the image, and then you`d need to depend on the user agent being OK
(, Sun 12 Feb 2006, 22:19, archived)
# Right.
Unfortunately I am too tired/lazy to think about this now. So I shall save it to be thought about later.
(, Sun 12 Feb 2006, 22:32, archived)