Home > Web Front-end > JS Tutorial > When Jquery loads, read data from the background and bind it to the dropdownList instance_jquery

When Jquery loads, read data from the background and bind it to the dropdownList instance_jquery

WBOY
Release: 2016-05-16 17:32:25
Original
1364 people have browsed it
复制代码 代码如下:

$(document).ready(function () {
loadSchools();
});
function loadSchools() {
var url = "@Url.Action("GetSchools")";
$.ajax({
url: url,
type: "GET",
dataType: "json",
error: function () {
alert("Error");
},
success: function (data) {
var items = "";
$.each(data, function (i, school) {
items = "";
});
$("#SchoolId").html(items);
}
});
}
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template