jquery.get

$(document).ready(function() {
	var areaSelect = $("#auto_testcase_area");
	var scriptSelect = $("#auto_testcase_name");
	areaSelect.change(
	function() {
		var t_area = areaSelect.val();
		$.get("auto_testcases/change_script_name", {
			area: t_area
		},
		function(data) {
			if (data.length != 0) {
				scriptSelect.html("");
				$("<option value=''>--请选择序列--</option>").appendTo(scriptSelect);
				for (var i = 0; i < data["name"].length; i++) {
					$("<option>" + data["name"][i] + "</option>").appendTo(scriptSelect)
				}
			} else {
				scriptSelect.html("");
				$("<option value=''>--请选择序列--</option>").appendTo(scriptSelect)
			}
			t_area.data(t_area, data)
		},
		"json")
	});
});

 

你可能感兴趣的:($.get)