首页 > 技术文章 > mvc ajax dropdownlist onchang事件响应

jonesvale 2015-09-14 09:51 原文

<script type="text/javascript">
$("#Cycle").on("change", function () {
var checkIndex = $("#Cycle").get(0).selectedIndex; //获取选择项ID
getDatas(checkIndex);
});
function getDatas(cIndex) {
$.ajax({
type: 'POST',
url: "EquipmentAssetss/Machine_Logs/GetDList?CycleItem=" + cIndex, 传参处理onchang事件响应
global: false,
cache: false,
success: function (response) {
$("#divsection").empty();
$("#divsection").append(response);
}, //提交成功后返回成功刷新
error: function (json) {
alert("数据加载异常,请刷新后重试...");
}
});
}
</script>

推荐阅读