我無法解決以下代碼出錯的地方 我的完整url是http://localhost:4244/Invoice/PayInvoice?invoicenumber=7069但VAR URL = window.location.href;只返回http://localhost:4244/
<a Class="btn btn-success btn-sm confirm" href="/Invoice/PayInvoice?invoicenumber=7069">Pay Invoice</a>
任何人能發現我在做什麼錯
<script>
$(document).ready(function() {
$(".confirm").click(function (e) {
var url = window.location.href; // Returns full URL
alert(url);
$("#displayPopUp").show();
e.preventDefault();
$(".yesupdate").click(function() {
$("#displayPopUp").hide();
window.location = url;
//$(location).attr('href');
});
//if (AcceptPayment()) {
// // then redirect to original location
// window.location = this.href;
//}
//else {
// alert("Couldn't do my thing first");
//}
//var result = window.confirm("You are about to mark invoice as paid, are you sure?");
//if (result == false) {
// e.preventDefault();
//}
});
});
</script>
我試圖做的是傳遞的價值url到window.location = url;點擊.yesupdate時
嗨@Jonathan Lonowski謝謝, – 2015-01-26 20:34:13