$(document).ready(function(){
$.ajax({
type:"post",
url:"${pageContext.request.contextPath}/findcollege.do",
success:function(rs){
var collegeList=eval(rs);
for (var i = 0; i < collegeList.length; i++) {
var c=collegeList[i];
$("#college").append("<option value='"+c.cid+"'>"+c.cname+"</option>");
}
}
});
});
【1】在下面代码里打个断点,,或者alert一下,看看有木有顺利执行
success:function(rs){
var collegeList=eval(rs);
for (var i = 0; i < collegeList.length; i++) {
var c=collegeList[i];
$("#college").append("<option value='"+c.cid+"'>"+c.cname+"</option>");
}
}
【2】如如果能执行到那就是解析的问题
url:"${pageContext.request.contextPath}/findcollege.do",
这个路径是一个绝对路径吧?
最好写成相对路径,
你的问题题目显示问题,那到底是什么问题呢???扔一段代码怎么能知道是什么问题?
在你的success
中 打个断点看一下咯~