這裏是我的問題。警報不起作用。成功後編碼不起作用
我的代碼工作正常。當我把斷點在Mozilla Firefox瀏覽器的腳本中,然後運行應用程序。
但它沒有運行時,我拿斷點。甚至警覺也沒有停頓。
這裏是我的代碼
function OpenOrdershipment()
{
var arrayOrderId = '';
var arrayChannelOrderReference = new Array();
var Url = '<%: Url.Action("OrderShipment", "Shipments") %>';
$.ajax({
cache: false,
type: "POST",
url: Url,
data: "strOrderId=" + arrayOrderId + "&ChannelOrderReference=" + arrayChannelOrderReference + "&strOpenShipments=" + 1,
dataType: "HTML",
success: function (data) {
if (data != "0" && data != "") {
alert(data);
arrOrderId = data;
$('#Hiddenid').val(arrOrderId);
document.forms["shipform"].submit();
}
else {
SucessErrorMessageDisplay('DivSuccessErrorMess', 'lblSuccessError', 'imgStatus', 1, 'There is no open shipments');
}
},
error: function (xhr, ajaxOptions, thrownError) {
if (xhr.status == 403) {
window.location.href = '<%: Url.Action("SessionExpire", "Home") %>';
}
}
});
}
<% using (Html.BeginForm("OrderShipments", "Shipments", FormMethod.Post, new { @id = "shipform" })) // Creates <form>
{%>
<input type="hidden" id="Hiddenid" name="orderId" />
<input type="submit" value="book" style="display: none" />
<%} %>
的原因是什麼?爲什麼它不工作?...
你在哪一行放置斷點?警報是否顯示斷點? – Francois