View Single Post
  #1 (permalink)  
Old Oct 13th, 2006, 17:50
commodorejim commodorejim is offline
New Member
Join Date: Oct 2006
Location: Tipperary
Age: 32
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Javascript code ignored by Netscape/Firefox

Hi everyone, new to the forum and I've had a look around but couldn't find an answer to the question I'm about to ask. Apologies if it has been dealt with before.

I'm trying to get the below code working in Netscape/Firefox. It's just a simple routine to load a different image depending on the user's resolution. It works perfectly in Opera and Explorer but Firefox and Netscape completely ignore it. No error messages or anything, it just doesn't run.

Could somebody far more knowledgable in Javascript than I am please have a quick glance to see if they can spot what might need to be added in order to make it run in those browsers? Thanks in advance to anyone who has a shot.

Code: Select all
 
if (screen.height >= 864 && screen.width >= 1152) 
{document.write("<img src='images/logo3(1152-864).jpg' width=996 height=90 border=0 alt=home>");}
 
else {if (screen.height == 768 && screen.width == 1024) 
{document.write("<img src='images/logo2(1024-768).jpg' width=855 height=90 border=0 alt=home>");}
 
else 
{document.write("<img src='images/logo(800-600).jpg' width=750 height=90 border=0 alt=home>");}}
Reply With Quote