View Full Version : java redirecting

07-12-2007, 08:15 AM
I completely have no knowledge about java. so please if I ask this question. this means you probably say what a dumb *** question

ok now I start
can anyone tell me how to redirect to another location with condition?
window.location = 'http://www.yourdomain.com'
I got this script somewhere , and yup I know what it means.

but firstly, before redirecting , I wanna make sure the visitor has javascript enabled before perform any further web browsing. you know what I am saying?

something like this
if no javascript then come up with another page saying " please enable javascript " or message to enable.

else redirect to another location

this might be piece of cake for you guys.
I have no knowledge about java. I am learning PHP . so ... pardon me for asking dumb question .

07-12-2007, 11:21 AM
I think you are asking about how to perform a redirect in JavaScript and not in Java.

Java and JavaScript are completely different programming languages...and the two are used for different purposes. Please do a google search on the difference between the two...as I could write a whole book about that.

As for alerting the user that JavaScript must be enabled if it is disabled. I think the best thing to do is to use the "noscript" tag...which will be displayed if javascript has been disabled on user's browser.

In order to use this website, you must have JavaScript enabled. <br/>
if you are using Internet Explorer...this is how ...etc

Hope that helps.