+ 2
Help me for my project
Sorry for my bad English I only want in js So i am currently making a ATM project using html , css , js ....now there an alot pages like 1st page -> login page and if user details right , it will enter into 2nd page that was -> Transaction, loan , access control and now let's say I clicked transaction and it will display the following operations like " Withdraw , deposit etc..(3rd page) but now I want to back to my previous page ( Previous page which was 2nd page Transaction , loan , access control) ...i tried some methods such as goback(-1) , windows.history etc...but none of it's work instead they worked like it's completely back to my chrome page !!!! PLEASE SOMEONE TELL
5 ответов
+ 1
You can get that with using:
window.location = "https://www.your-page.com";
Here an example:
https://sololearn.com/compiler-playground/WadImu130sKv/?ref=app
0
I know, that it would not be what you want, but what about opening 3rd page in new tab (target=_blank) and after deposit or whatever on 3rd page closing this 3rd page And the 2nd still remain opening?
0
@Václav Dostál i can't find reply button ? Anyways , I cant open on new page cuz the details will be displayed on ATM screen , like a real ATM
0
Here are similar topics in the forum and maybe there are some examples in the code playground. Let's check it out:
https://www.sololearn.com/discuss/2350682/?ref=app
https://www.sololearn.com/discuss/380140/?ref=app
https://www.sololearn.com/discuss/1684724/?ref=app
https://www.sololearn.com/discuss/2371899/?ref=app
https://sololearn.com/compiler-playground/W5k1eKRl8v0N/?ref=app
https://sololearn.com/compiler-playground/WJzEtlmtaQ8h/?ref=app
https://sololearn.com/compiler-playground/W0uW3Wks8UBk/?ref=app
0
What did you use for redirecting from one page to another???
If you used window.location.href = URL
Then window.history.back() should work.
If it doesn't then save each pages url in an array such that each time you get to the page, and also create a back function to pop out the last URL of the array and redirect to that URL.
I remember doing something like that when I was working on Angular, I'll try making it here...
Edit: check out the JavaScript here
https://sololearn.com/compiler-playground/Wep70RbZ3L5f/?ref=app