我想知道为什么这个处理程序会在两次按钮点击时触发?
<script type="text/javascript">
$(document).ready("#testbutton").click(function () {
$.ajax({
url: '@Url.Action("RenderBlogComments","Home")',
success: function (data) {
// your data could be a View or Json or what ever you returned in your action method
// parse your data here
alert(data);
}
});
});
</script>
<input type="submit" name="testbutton" value="submit" id="testbutton" />
<input type="submit" name="testbutton" value="submit" id="testbutton2" />