PHP / Javascript:History.go(-1)无效,浏览器返回DOES

I changed something between last night and this morning and now my back buttons are not working.

I have used

<button type="submit" onClick="history.go(-1)">Back</button>

without a problem up until this morning. Now, when this button is clicked, the previous URL is loaded, but my PHP $_SESSION is not, cause me to be redirected to my login page.

If I use the browsers built-in back button, it loads without any problems.

This problem persists in both FireFox 38.0.5 and IE 11.

I have tried history.go(-1), history.back and a few others and there is something wrong with the JS.

Any ideas what to look out for? I am by no means a JS expert (this is about as much as I do) and my site has virtually no JS in it to begin with.

I'd love to give more code examples, but as I haven't the faintest idea where the problem is, I would only be able to upload my entire system...

Thanks in advanced.

2015/06/25 06:56
  • php
  • javascript
  • 点赞
  • 收藏
  • 回答