Power Rangers | Credit Counseling | Personal Loans | Loans | Online Degree Certificate
js redirect not working [Archive] - PCMech Forums

PDA

View Full Version : js redirect not working


craigtaylor74
04-20-2004, 07:41 PM
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.

kram 2.0
04-20-2004, 09:44 PM
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

craigtaylor74
04-21-2004, 10:36 AM
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
04-22-2004, 06:01 AM
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.