OnCompleteStuff 永远不会被调用,我做错了什么?
<script type="text/javascript">
function OnBeginStuff() {
$("#StuffPanel").fadeTo("slow", 0.50);
}
function OnCompleteStuff(request, status) { // Never called
$("#StuffPanel").fadeTo("slow", 1.00);
}
$(document).ready(function () {
$('.mainLink', $('#NavigationPanel')).click(function (e) {
e.preventDefault();
$.ajax({
url: $(this).attr('href'),
beforeSend: OnBeginStuff,
complete: OnCompleteStuff,
success: function (html) {
$('#StuffPanel').html(html);
}
});
});
});
</script>
</head>
<body>
<div id="NavigationPanel">
@Html.ActionLink("1", "Index", "One", null, new { @class = "mainLink" })
@Html.ActionLink("2", "Index", "Two", null, new { @class = "mainLink" })
@Html.ActionLink("3", "Index", "Three", null, new { @class = "mainLink" })
</div>
<div id="StuffPanel">
@RenderBody()
</div>
</body>
</html>