开发者

Go back Javascript not working for Safari

I am trying to implement a go back button using javascript. The code below works fine for ie and firefox. It doesnt work for safari though. Any ideas to fix the problem?

<A href="javasc开发者_开发技巧ript:history.back()"><IMG border=0 src="imageurl1"></A>`

 I tried history.go(-1) as well. 

Thanks,


You can try making a function with preventDefault like this:

function goBackHistory(){
  history.go(-1);
  event.preventDefault();
}

and then call function from html

<a href="javascript:goBackHistory()"><IMG border=0 src="imageurl1"></a>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜