samedi 12 septembre 2020

Load an HTML Page (in same tab) stored within same folder by Javascript

So there are html pages, 'login.html' and 'register.html' stored within same folder on my desktop.

when i open my login.html page it has a button when clicked should be redirected to register.html page.

The Folder

i have checked that the button event it self is working fine when button is pressed the event is fired (confirmed through alert method)

    document.getElementById('logIn').onclick= function(){
    window.location.href("login.html") // does not works 
    window.location.href("./login.html") // does not works 
    window.location.href("/login.html") // does not works 
    window.location ="login.html" // does not works 
    window.open("login.html")// open it but in a new tab (which i dont want)
    window.open("login.html","_self")// does not works 
}

also i am not using jquery for this project.




Aucun commentaire:

Enregistrer un commentaire