我正在寻求一些 JS 不正常的帮助。我想这样做,以便我可以传递一些 JavaScript 来影响最终 URL 目标,如下所示: 最终目标是 ( delete-page.php?id=1
)
<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>
任何帮助将不胜感激!