Help me for my project | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 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 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

23rd Feb 2024, 6:15 PM
Vicky X
Vicky X - avatar
5 Respuestas
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?
23rd Feb 2024, 6:55 PM
V√°clav Dost√°l
V√°clav Dost√°l - avatar
@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
23rd Feb 2024, 7:40 PM
Vicky X
Vicky X - avatar
You can get that with using: window.location = ""; Here an example:
23rd Feb 2024, 11:33 PM
JaScript - avatar
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
2nd Mar 2024, 5:18 PM
IAmSupreme - avatar