asp.netのjavascriptでプロンプトで別のページにリンクする方法
他に別のページをリンクしたい
function a()
{
var s = prompt("hello");
if (s != 123) {
alert("enter number correctly");
return true;
}
else
return false;
}
asp.netのjavascriptでプロンプトで別のページにリンクする方法
他に別のページをリンクしたい
function a()
{
var s = prompt("hello");
if (s != 123) {
alert("enter number correctly");
return true;
}
else
return false;
}
window.location.hrefを使用して、else 部分で別のページを開くことができます。
function a()
{
var s = prompt("hello");
if (s != 123) {
alert("enter number correctly");
return true;
}
else
window.location.href = 'http://www.google.com';
}