2012-04-06 38 views
0

我有以下的HTML代碼按鈕去同一地址

[email protected] wants to be your partner. Do you agree? 
<br><input type="button" id="1" name="btn1" class="button" value="Yes" onclick="window.location='confirm/[email protected]';" />  
<input type="button" id="2" name="btn2" class="button" value="No" onclick="window.location='decline/[email protected]';" /> 

問題是,當我在沒有按鈕,它讓我在同一個地址confirm/[email protected]點擊。

我該如何正確重定向?

+0

您在測試什麼瀏覽器? – Greg 2012-04-06 07:41:00

+0

谷歌瀏覽器和Internet Explorer – opc0de 2012-04-06 07:47:08

+0

好吧,我很難過。我剛剛創建了一個獨立的.html文件,其中包含代碼,並執行了JSFiddle,兩者似乎都能正確導航...... :-( – Greg 2012-04-06 07:49:12

回答

1

嘗試使用window.location.href =

+0

這不會改變它 – 2012-04-06 07:27:29

+0

仍然是相同的結果 – opc0de 2012-04-06 07:29:42