I was wondering if someone could help me out. I don't know much about javascript, but I'm just looking for a pretty simple/common function. I want something like when you log on here, it takes you to a certain page, then sends you back to previous page automatically. how do I do this?
It not possible using JavaScript alone. The form which you use to submit your username and password contains a hidden field whose value is set to the URL of the page on which you filled the form. When you submit the form, the URL is also send. If the login is successful, you get redirected back to the URL which was sent with the form.
The browser history is available to javascript, it is manipulated much like a recordset. http://www.devguru.com/Technologies/ecmascript/quickref/history.html
Thanks for the link, Sleeping Troll. So will history.go(-1) do it automatically, or is there something else I need to add?
that would take them back but not as if they were logged in. Also you will need to go 2 pages back, not 1.
I'm confused. if I put this after the script runs, why would it not act as if they were logged in, as a cookie would be put in place? secondly, why go back 2 pages instead of 1?
ok, I just tried it the way I said it, and it does log them in, but they have to refresh to see the difference. how can I fix that?