Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 04-20-2004, 06:41 PM   #1
Member (7 bit)
 
Join Date: Jan 2002
Location: Barcelona
Posts: 85
js redirect not working

Hi,
I´m using the following js to redirect form an external js file:

if (screen.width==800||screen.height==600) //if 800x600
window.location.replace("http://www.glasgowapartment.co.uk/index800.htm")

else if (screen.width==640||screen.height==480) //if 640x480
window.location.replace("http://www.microsoft.com")

else if (screen.width==1024||screen.height==768) //if 1024x768
window.location.replace("http://www.glasgowapartment.co.uk")

else //if all else
window.location.replace("http://freewarejava.com")

but somethings not right as when I press go in the address bar it does redirect the address it is searching for but nothing else happens ... the address and the status bar just flicker away. Difficult to explain but if you have 800*600 resolution you can see by entering www.glasgowapartment.co.uk
Any ideas would be appreciated.
craigtaylor74 is offline   Reply With Quote
Old 04-20-2004, 08:44 PM   #2
Moderator
Staff
Premium Member
 
Join Date: Aug 2003
Location: Richmond, VA
Posts: 7,835
See what happens when you put it directlty into the page's syntax - I've had trouble sometimes with the pages calling for external script.

Hope that helps,
kram
__________________
"For today, goodbye. For tomorrow, good luck. And forever, Go Blue!"
University of Michigan President Mary Sue Coleman
kram 2.0 is offline   Reply With Quote
Old 04-21-2004, 09:36 AM   #3
Member (7 bit)
 
Join Date: Jan 2002
Location: Barcelona
Posts: 85
nope ... just the same. one interesting twist is that when I use Dreamweaver and the Preview in Browser command it works fine, but as soon as I upload it and try it for real ... the address bar and status bar fill with the correct destination but just flicker away.
craigtaylor74 is offline   Reply With Quote
Old 04-22-2004, 05:01 AM   #4
Member (7 bit)
 
Join Date: Jan 2002
Location: Barcelona
Posts: 85
OK, I think I´ve got to the bottom of it ... I was adjusting my screen resolution whilst the browser was open and then retrying the redirect. If I close the browser and adjust then reopen it seems to work.
craigtaylor74 is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 12:53 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2