写了一段代码:
<script type="text/javascript" language=javascript>
$(function () { $(bclick).click(AjAX)})
function AjAX() {
$.ajax({
type: "post",
url: "Handler1.ashx",
success: function (msg) { alert(msg) }
})
}
</script>
<body>
<form id="form1" runat="server">
<input id=bclick type="button" value="button" />
</form>
</body>
点击button时提示bclick没定义,bclick明明已经定义了??
属性名 加 双引号, jquery 访问id,不是要加# 吗? $('#bclick').
将$(bclick)改为$("#bclick")