Javascript code ignored by Netscape/Firefox

This is a discussion on "Javascript code ignored by Netscape/Firefox" within the JavaScript Forum section. This forum, and the thread "Javascript code ignored by Netscape/Firefox are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Oct 13th, 2006, 17:50
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

  #2 (permalink)  
Old Oct 13th, 2006, 20:20
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to ukgeoff
Re: Javascript code ignored by Netscape/Firefox

Put ' either side of all your attribute values.
Reply With Quote
  #3 (permalink)  
Old Oct 14th, 2006, 10:13
New Member
Join Date: Oct 2006
Location: Tipperary
Age: 32
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Javascript code ignored by Netscape/Firefox

Hi Geoff, thanks a million for that - it worked like a charm. Can't believe it was something that simple, I feel like an idiot! Thanks again.
Reply With Quote
Reply

Tags
firefox, javascript, netscape

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
firefox, netscape, & IE9 browser trouble! Welsh8 Web Page Design 14 May 11th, 2008 08:39
CSS & Firefox/Netscape beerme Web Page Design 1 Feb 9th, 2008 03:46
Content appears fine in Firefox and Netscape but not IE Lyss Web Page Design 3 Oct 11th, 2006 00:30
DIV alignment in Firefox and Netscape johnmr Web Page Design 1 Sep 11th, 2006 17:15
Flash Slideshow Problem in Firefox & Netscape tachacha Flash & Multimedia Forum 2 Sep 6th, 2006 02:13


All times are GMT. The time now is 05:09.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43