语法错误:在jQuery中的元素列表后缺少] [英] SyntaxError: missing ] after element list in jquery

查看:108
本文介绍了语法错误:在jQuery中的元素列表后缺少]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为StudentDetailsVo列表项分配对象.

i want to assign object for StudentDetailsVo List items.

我一直在收到此错误.

 $("#searchAtten").click(function(){
            $("#tablerows").empty();
            var sectionId=$("#selSection :selected").attr("id");
            var studid=$("#studentid").val();
            var datee = ${resultVO.monthEndDate}
            var reqD = ${resultVO.reqdEndDate}
            //I need to assign object here 
            var namem =${resultVO.studentList}
            alert("namem"+namem);
            var betweentDate=  reqD-datee;
            alert("betweentDate = "+betweentDate);
            for(var i=1;i<=datee;i++){
                alert(i);
                $("#tableRows tr").append('<th width="129" scope="col"  style="text-align: center;">'+i+'</th>'); 
            } 
             if(sectionId == undefined)
                {
                sectionId = "null";
                }
             if(studid == "")
            {
                studid = "null";
            } 
                fetch_atten(sectionId,studid);          
                });
    });

我正在从VO文件中获取此值:

i am taking this values from VO Files :

<% if (session.getAttribute("resultVO") != null){
     AttendanceResultVO resultVO= (AttendanceResultVO)session.getAttribute("resultVO");
         } 
%>

**>我的萤火虫错误是:

**> my fire bug error is :

SyntaxError: missing ] after element list
[Break On This Error]     

var namem =[com.sfmfm.vo.StudentDetailsVO@487c5f]

myschool.jsp (line 53, col 43)**

推荐答案

如果您查看第43列,则位于'@'.使用

If you look at column 43 you are at '@'. Use

var namem = ['com.sfmfm.vo.StudentDetailsVO@487c5f'];

我担心,尽管文本是无法使用的toString,但不再可映射到对象本身.

though the text is a unusable toString, not anymore mappable on the object itself, I fear.

为简化起见,删除不必要的空格/换行符,我将保留分号.

For minification, removing unnecessary whitespace/newlines, I would leave in semicolons.

这篇关于语法错误:在jQuery中的元素列表后缺少]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆