-
load function
can anyone tell me what is it that I am doing wrong in this code?
This should take me to the page if the password is ioncorrect but instead the browser says page not found
....
else{
alert("Invalid username & password")
load('wrongpage.html')
}
}
function load(url)
{
location.href=url;
}
i also tried window.location = "asdasd.html", it dosent work
-
-
Well, for one you have to have the file in the same directory as the link it's coming from. Otherwise you have to write the whole thing: http://....../../wrongpage.html
- Mike
-
-
That's a bit oversimplified, but hits on the problem. It sounds as though the page isn't in the same directory as the script. You can use absolute URLs as mburt suggested, or, preferably, you can use relative URLs like "../wrongpage.html".
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks