<script type="text/javascript">
$(function() { $("#btnSQ").click(function() {
debugger;
var inputs = document.getElementsByTagName("input");
for (var i = 0; i < inputs.length; i++) {
if (inputs[i].type == "checkbox" && inputs[i].checked) {
var brandCouponID = inputs[i].val();
$.ajax({
type: "Post",
url: ajaxPath + "?__Action=BrandCouponInsert",
data: { brandCouponID: brandCouponID },
dataType: "json", success: function(data) { },
error: function(err) { }
});
};
};
});
});
</script>
写在HTML里面运行后$.ajax前面的$没了。
<script type="text/javascript">
$(function() { $("#btnSQ").click(function() {
debugger;
var inputs = document.getElementsByTagName("input");
for (var i = 0; i < inputs.length; i++) {
if (inputs[i].type == "checkbox" && inputs[i].checked) {
var brandCouponID = inputs[i].val();
.ajax({
type: "Post",
url: ajaxPath + "?__Action=BrandCouponInsert",
data: { brandCouponID: brandCouponID },
dataType: "json", success: function(data) { },
error: function(err) { }
});
};
};
});
});
</script>这是运行后的源代码
$(function() { $("#btnSQ").click(function() {
debugger;
var inputs = document.getElementsByTagName("input");
for (var i = 0; i < inputs.length; i++) {
if (inputs[i].type == "checkbox" && inputs[i].checked) {
var brandCouponID = inputs[i].val();
$.ajax({
type: "Post",
url: ajaxPath + "?__Action=BrandCouponInsert",
data: { brandCouponID: brandCouponID },
dataType: "json", success: function(data) { },
error: function(err) { }
});
};
};
});
});
</script>
写在HTML里面运行后$.ajax前面的$没了。
<script type="text/javascript">
$(function() { $("#btnSQ").click(function() {
debugger;
var inputs = document.getElementsByTagName("input");
for (var i = 0; i < inputs.length; i++) {
if (inputs[i].type == "checkbox" && inputs[i].checked) {
var brandCouponID = inputs[i].val();
.ajax({
type: "Post",
url: ajaxPath + "?__Action=BrandCouponInsert",
data: { brandCouponID: brandCouponID },
dataType: "json", success: function(data) { },
error: function(err) { }
});
};
};
});
});
</script>这是运行后的源代码
html中是可以写ajax代码的啊!
你把加上去呀
$.ajax({