日期:2014-05-17 浏览次数:20664 次
<script type="text/javascript" src="js/jquery-1.4.2.js"></script> <script type="text/javascript"> $('document').ready(function(){ //取得学校放入下拉框 $.ajax({ type: "post", url: "GetAllSchoolServlet", dataType: "String", success: function (data) { var obj = eval('(' + data + ')'); for (var i=0;i<obj.length;i++){ var scode = obj[i].scode; var sname = obj[i].sname; var opt = '<option value="'+scode+'"selected>'+sname+'</option>'; $('#selSchool').append(opt); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert("ajax取学校信息出错-"+errorThrown); } }); }); </script>