今晚用jquery写一个级联下拉单搞了很久都没成功,最后才发现问题在servlet返回的数据。
/*jquery代码*/ $.post("GetContent",{keyword:'yes'},function(data){ //receive content },'json') ;
/*servlet代码*/
response.setContentType("application/x-json") ;
response.getWriter().print("['A','B','C']") ;//内容的引号一定要