Main Topics
Browse All TopicsHello,
I have a website which has a background tile image. However, I need to change the background tile image if the browser is Firefox.
Hence for IE the body tag is:
<body>
But for Firefox it must be:
<body style='background-image:ur
I have attached a code snippet in which I successfully use JavaScript to detect if the browser is Firefox. However, when I view the site in Firefox the whole page simply displays:
style='background-image:ur
and that's it, just that line of code and nothing else. It works fine in IE.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
In response to the 3 preceding reponses:
1. I have checked the styles by manually embedding them and ite work. So I have ruled out any issue with the style.
2. I have looked at the quirksmode link but I have no issue detecting the browser, it is simply embedding the css that is the problem.
3. I have checked the path by embedding the style so that is not the issue either.
you're embedding style, but for what element? what i mean is where is that code going to be placed? that's why I said explicitedly set
2:
3:
4:
5:
6:
7:
<script type="text/javascript">
function checkfirefox(){
if (navigator.userAgent.index
{
document.body.style.backgr
}
}
</script>
<body onload="checkfirefox()">
Business Accounts
Answer for Membership
by: silemonePosted on 2008-11-09 at 06:57:59ID: 22916477
try using this script or any other standard browser javascript to see if it works...
if not, then there may be an error with your styles.