Jump to content

javascript:history.go(-1); or javascript:history.back(); ?


Mengao

Recommended Posts

I tested them and I know they do the same thing, but why almost all webpages use history.go(-1)?Is it more recommended?Thanks in advanceMengao

Link to comment
Share on other sites

The only difference I know is that history.back() can go only one step back from current position while history.go() takes as argument the number of steps you want to go back. It can be history.go(-1) or history.go(-3)...Also history.go can have a positive number as argument, which means it will go forward

Link to comment
Share on other sites

The only difference I know is that history.back() can go only one step back from current position while history.go() takes as argument the number of steps you want to go back. It can be history.go(-1) or history.go(-3)...Also history.go can have a positive number as argument, which means it will go forward
Ok. Thanks Lulzim!
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...