ajax is not defined异常解决

首先这个异常是在前端页面展示出来的,可以采用浏览器的开发者模式,进行查看显示时候的异常。

这个异常不清楚有没有其他的出现情况:

我的只是因为,在ajax模板中没有加入$,哎,本屌人生中的一大败笔啊。

$.ajax({
             type: "post",
             url: "${pageContext.request.contextPath}/**",
             data: {username:$("#username").val()},//需要传递的参数
             dataType: "json",//数据响应格式
             success: function(data){
                         $('#resText').empty();   //清空resText里面的所有内容
                         var html = ''; 
                         $.each(data, function(commentIndex, comment){
                               html += '
' + comment['username'] + ':

] + '

'; }); $('#resText').html(html); } });

你可能感兴趣的:(Error实例)