vendredi 26 juin 2015

please fix my javascript [on hold]

my javascript has some bug in it that whenever i "log in" the outside function starts working first then the inside one

what i want to do is to make sure that the user "james" logs in perfectly if not it will close the window (instead i put alert('lol'))

but instead the script does the alert('lol') first rather than the one inside the brackets then it will do the one inside the brackets

please fix it thanks`

<!DOCTYPE html>
<html>
<head>
        <title>hek</title>
</head>
<body>

<script type="text/javascript">


var login = prompt('Enter Username');
        
if(login == 'James'){ 

        var pass = prompt('Enter Password')

                if(pass == 'python'){

                        window.location.replace('http://ift.tt/1QI4Ajl'); 

                }

}



</script>

<script type="text/javascript">
        alert('lol')
</script>

</body>
</html>

`




Aucun commentaire:

Enregistrer un commentaire