ajax is not defined异常解决

来源:互联网 发布:苹果手机导出照片到mac 编辑:程序博客网 时间:2024/06/05 19:56

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

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

我的只是因为,在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 += '<div class="comment"><h6>' + comment['username']                                         + ':</h6><p class="para"' + comment['content']                                         + '</p></div>';                         });                         $('#resText').html(html);                      }         });

1 0
原创粉丝点击