9
Would you like to know what is the best practice for that standard button/link (back) in the applications?
Today I use href="javascript:history.back();"
however there are some considerations that over time I have come across, are 3 doubts:
INCOMPATIBILITY - I’ve been in situations
javascript:history.back();
not being compatible with some specific browsers/versions, and not working, even with client-enabled Javascript. Would there be any other measure to be used for this situation?OPTIONS - I know that
href="javascript:history.back();"
returns to the client’s last navigation page, and if needed to return 2 pages with Javascript?PHP - Knowing that it is a server-side language, even so, there would be something in PHP to do this function, native or not, and not using Javascript?
Note: Regarding doubt 3, I have already used in some systems a kind of page capture per session
, where a history was assembled accompanying navigation, this way could direct a link back to any level of browsing history, because sometimes I need to go back one, two, or even 3 pages of this history, I discontinued this function in the new systems because I believed it was too unnecessary processing, and ended up using only javascript:history.back();
and when necessary on specific occasions do a "gambiarra".
Thank you very much for your reply, cleared all doubts. Answer 2 worked perfectly, the question of compatibility with time we will know through feedbacks.
– Thyago ThySofT
Congratulations on the well organized question, it is very well formatted.
– Thiago Yoithi