Does anyone know what's the problem with this javascript code here:
function a() {
var origionalurl = window.location
var arraywithurl = origionalurl[1].split("=")
var finalurl = arraywithurl[1]
alert(finalurl)
window.location = finalurl
}
I'm a begginer, so it's probably something very basic.
What I'm trying to do is redirect someone to a URL in a variable called "loc" in the address bar. So, I get the starting URL (It would look something like "myURL?loc=another_URL") and split it into two parts ("myURL?loc" and "another_URL") and then tell the person a message and then redirect them to "another_URL". What's my problem?
Last edited by shane.carr; 05-31-2006 at 06:36 PM.
Reason: changed "java" to "javascript"
Bookmarks