Monday, 15 September 2014

javascript - webkit / Chrome history.back(-1) onclick vs href -



javascript - webkit / Chrome history.back(-1) onclick vs href -

everybody knows i'll repeat problem:

<a href="#" onclick="history.go(-1)">back</a>

will not work in webkit based browsers (chrome, safari, mxthon, etc.)

another approach (should work) won't work is:

<a href="#" onclick="javascript:window.history.back(-1);">back</a>

you - works! (but that's showing js in url hint)

<a href="javascript:window.history.back(-1);">back</a>

to utilize js in onclick event (works, see comments below):

<a onclick="javascript:window.history.back(-1);">please seek again</a>

missing href create work, won't appear clickable link, apply css create link, apply bluish color, underline , cursor hand, wants that?

finally working solution, tested in ie, ff, safari, chrome, opera, maxthon:

<a href="#" onclick="window.history.back();return false;">back</a>

don't forget semicolon after homecoming false;

javascript google-chrome onclick href

No comments:

Post a Comment