简单的Javascript帮助请求

时间:2012-04-28 04:23:17

标签: javascript jquery

我正在帮助一些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>

非常感谢任何帮助!

1 个答案:

答案 0 :(得分:1)

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

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