Skip to main content

Command Palette

Search for a command to run...

How to go back on previous url with previous information using javascript function?

Published
2 min read
S

Software Engineer | #Blockchain developer | Blogger :)

oie_T3Gdcr0TNur1.jpg am sharing some information here, maybe you will get this much space.Many times we perform such functionality in which the last information is lost if the URL is to be returned.Either we store them in the session or cookies or we pass and hold the parameter through the URL.It becomes a long procedure and the coding is not flowing according to the standard.

I am going to tell you what is going to be told to you, but many people who do not know and like me have been stuck many times, it will be very easy for them.You should do a simple method of JavaScript.

window.history.back();

Call it via OnClick at the place where you have given your back button.Many times, when you make this return, the page will kill and give an error of cache.

For which you can pass the header to the first file

header('Cache-Control: no cache'); //no cache
session_cache_limiter('private_no_expire'); // works
session_cache_limiter('public'); // works too

This is your simple method, you collect information and return. Mostly, it is a problem to submit the form to you, or if you have taken any action after doing search functionality.

B

Good one Shantun Parmar!

Keep it going!

More from this blog

S

Shantun's Blog

30 posts

Software Engineer| #Blockchain developer | Blogger :) Connect with me on Twitter