2013-01-16 46 views
1

如何鏈接到另一個頁面提示在javascript在asp.net鏈接到另一個網頁中promp在javascript在asp.net

在其他

我要將另一個頁面

function a() 
{ 
    var s = prompt("hello"); 
    if (s != 123) { 
     alert("enter number correctly"); 
     return true; 
    } 
    else 
     return false; 
} 
+0

你看「Javascript重定向」了嗎? - ''window.location =「http://www.yoururl.com」;' –

回答

0

你可以使用window.location.href在其他部分打開其他頁面。

function a() 
{ 
    var s = prompt("hello"); 
    if (s != 123) { 
     alert("enter number correctly"); 
     return true; 
    } 
    else 
     window.location.href = 'http://www.google.com'; 
} 
+0

我使用radButton,並且在這個按鈕中這段代碼不起作用 – amertat

+0

你能否推辭什麼不起作用?你得到什麼錯誤?同時添加你的teleric控制與代碼顯示與JavaScript的交互。 – Adil

相關問題