sasnaktiv
asked on
javascript onclick='history.go(-3); FAILS!
Hey Guys,
What's wrong with this javascript?
No matter what history I give it (-1) (-2) (-3) (-4) it only refreshes the page it is on.
If I change the "type" from "submit" to "button" nothing happens at all.
onclick='history.go(-3);return true;' has no effect either.
Have I lost my mind again?
Sas
What's wrong with this javascript?
No matter what history I give it (-1) (-2) (-3) (-4) it only refreshes the page it is on.
If I change the "type" from "submit" to "button" nothing happens at all.
onclick='history.go(-3);return true;' has no effect either.
Have I lost my mind again?
Sas
<form> <input name='Back' type='submit' value='Go Back' onclick='history.go(-3);' style='height: 22px; width:280px; FONT-SIZE:12px; font-family:Arial;' >
</form>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Did you enable javascript enabed on browser> What browser are you using ?
If javascript is not enabled, you could not view the error message at browser develper tools ?
You know where is button for developer tools on browser ?
the html page, I tried, it works at my sides, no any issue
Why not send us your whole page ?
Duncan
If javascript is not enabled, you could not view the error message at browser develper tools ?
You know where is button for developer tools on browser ?
the html page, I tried, it works at my sides, no any issue
Why not send us your whole page ?
Duncan
copy wrong code to your, missing onclick="javascript:..."
Try it
Duncan
Try it
Duncan
<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/JavaScript">
function goBack() {
window.history.go(-1);
}
</script>
</head>
<body >
<button onclick="javascript:goBack();">Go Back</button>
</body>
</html>
ASKER
Sorry Duncan,
Nothing seems to be working. Not even when I create direct buttons (targeted to the correct document) using post or get. It just keeps refreshing the existing page.
Sas
Nothing seems to be working. Not even when I create direct buttons (targeted to the correct document) using post or get. It just keeps refreshing the existing page.
Sas
That page works at my side.
Could you send us the "not working" page ? including related code such as javascript
Duncan
Could you send us the "not working" page ? including related code such as javascript
Duncan
ASKER
Sorry Duncan,
The page is quite complex ad proprietary. So I can't send it along. I guess I'll have to continue trying to fix it or just give up on it.
How can I award you the points?
Sas
The page is quite complex ad proprietary. So I can't send it along. I guess I'll have to continue trying to fix it or just give up on it.
How can I award you the points?
Sas
Just close this thread without any points since I didn't solve your issue
Duncan
Duncan
ASKER
But there's nothing wrong with any of the code you suggested.
And I want to do what's right by you.
Sas
And I want to do what's right by you.
Sas
ASKER
Thanks for the help and attention Duncan. You are the only person who responded to my question.
Sas
Sas
Thanks for your points
Reminder and Note for other viewer: the solution is NOT fixed to author final question completely
have a nice day
Duncan
Reminder and Note for other viewer: the solution is NOT fixed to author final question completely
have a nice day
Duncan
ASKER
Unfortunately I still have the problem -- with either of your suggestions.
Go figure?
Sas