Linking to Google



I am trying to connect to Google via Javascript on my project, yet when I do that, it says that “” isn’t a file. Is there a way to overcome this problem and send someone to google after an alert?


What did you try to do so far? Example of code you used will be helpful, since it is not quite clear what exactly does connect to Google mean


Here is an example of the code. I’m making a password in a prompt box.

var password = prompt("Password Please.");

if(password === "Qwertu") {
    alert("Welcome Dylan");
else {
    alert("Go Away");

I’m trying to send the person with the incorrect answer to Google.


First of all, please do not use this code in production, it is an extreme security risk. That said, while I’m not sure why you’d want to send the user to Google if they fail to log in, here’s the solution:

window.location.href = "";