2012-04-28 77 views
1

我在一些JS的一些幫助不行爲。我想使它這樣我可以通過一個JavaScript來影響如下年底URL目標:最終目標是(delete-page.php?id=1簡單的Javascript幫助請求

<a href ="javascript:deletemessage('id=1')">Delete Page </a> 

<script type="text/javascript"> 
function deletemessage(url) { 
    $.msgbox("Are you Sure you would like to delete this page", { 
    type: "confirm", 
    buttons: [{ 
     type: "submit", 
     value: "No" 
    }, { 
     type: "submit", 
     value: "Yes" 
    }] 
    }, function(result) { 
    if (result == "Yes") { 
     window.location.href = "delete-page.php(URL)"; 
    } 
    }); 
} 
</script> 

任何幫助將非常感謝!

回答

1

替換: window.location.href = "delete-page.php(URL)";

有:window.location.href = "delete-page.php?" + url;

+0

乾杯!感謝堆,我知道我很接近。非常感謝! – Brandrally 2012-04-28 04:39:04

+0

實際上應該是''delete-page.php?' +網址 – h0tw1r3 2012-04-28 04:39:48