未捕获的TypeError:$(...)。jqGrid不是函数

时间:2016-09-25 15:40:59

标签: javascript jquery jqgrid

我尝试使用jqgrid,但我有问题:(

未捕获的TypeError:$(...)。jqGrid不是函数

可能这个问题很常见

但我无法解决有一天帮助我... :( ... 如果您想要更多代码评论,请

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../resources/css/style.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script type="text/javascript" src="/kwonsh2/resources/js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="/kwonsh2/resources/js/jquery.jqGrid.min.js"></script>
<script type="text/javascript" src="/kwonsh2/resources/js/grid.locale-ja.js"></script>


<link rel="stylesheet" type="text/css" media="screen" href="../resources/css/ui.jqgrid.css" />


<title>Insert title here</title>
</head>

<script type="text/javascript">


/* jqgird */


             $(document).ready(function(){



               $('#grid').jqGrid({
                       url : 'member/getlist',
                       datatype : 'json',
                       mtype : 'post',
                     /*   jsonReader : {
                            no : 'no' // 대표 아이디를 설정
                            ,root : 'name' // 데이터의 시작을 설정
                       }, */
                       colNames : [
                                        '名前',
                                       '社員番号',
                                       'パスワード'
                                  ],
                       colModel : [
                                 { name : 'name',         width:40,  align:'center'},
                                 { name : 'no',       width:80,  align:'left'  },
                                 { name : 'password',  width:80, align:'left'  }],

                       pager : '#pager',
                       rowNum : '10',
                       multiselect : true/* ,
                       postData : {
                            no : 'no',
                            name : 'name'
                       } */
                 });
     var successflag = $('#flag').val();
                    $('.memberdelete').on("click",function(){

                         var result = confirm('本当に削除しますか?');

                            if(result) {
                               //yes
                                 var dno = $(this).attr('delno');
                                 alert(dno);
                                 location.href = "memberdelete?delno="+dno;
                            } else {

                            }
             });    
});


</script>
<body>
<div class="all">

    <%@ include file="layout/header.jsp" %>

<div>

    <%@ include file="layout/menu.jsp" %>


 <div class="main">
  <c:if test="${not empty no}" >


     </c:if>
<table id="grid"></table>
<div id="pager"></div>
     </div>
</div>
</div>

</body>
</html>

1 个答案:

答案 0 :(得分:0)

尝试设置不src元素的<script>元素的<c>,例如,

<script type="text/javascript" src="/resources/js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="/resources/js/jquery.jqGrid.min.js"></script>
<script type="text/javascript" src="/resources/js/grid.locale-ja.js"></script>