How to redirect a URL using JavaScript?
Here's the code I've been working on:
function enter() {
var continuePrompt = true;
var url;
while (continuePrompt) {
continuePrompt = false;
url = prompt("Please Enter Website Address");
// Check if the entered address contains http://
if (url.indexOf('http://') === -1) {
alert("Invalid Web Address");
continuePrompt = true;
}
// Prompt for valid web address if nothing was entered
else if (url == '') {
url = prompt("Please Enter Valid Web Address");
}
}
}