简体   繁体   English

失踪 ; 声明前

[英]missing ; before statement

I've checked the other answers to similar questions - but so far no luck. 我已经检查了类似问题的其他答案-但到目前为止还没有运气。

I have the following code: 我有以下代码:

$("#alphaindex").click(function(e) {      
                var item = $(this).attr("title");
                e.preventDefault(); 
                $.getJSON("getContacts.cfc?method=getContacts&returnformat=json",{"alpha":item}, function(res,code){
                    if(res.ROWCOUNT > 0){
                        for(var i=0; i<res.ROWCOUNT; i++) {
                            s += "<h3 class='postTitle'>" + res.DATA.CONTACTFIRSTNAME[i] res.DATA.CONTACTLASTNAME[i] + "</h3>"
                            + "<p class='postDesc'>" + res.DATA.CONTACTEMAIL[i] + "</p>"
                            + "<p class='postDesc'>" + res.DATA.CONTACTMOBILE[i] + "</p> <br class='clr' />"
                            };
                        s += "";
                        } 
                    else {
                        var s = "Sorry, nothing matched your search.";
                    }
                    $("#results").html(s);

                    },"json");
                })
            });

and I'm getting the ; 而且我得到了; missing before statement message in relation to the line: 与该行有关的before语句消息丢失:

s += "<h3 class='postTitle'>...res.DATA.CONTACTLASTNAME[i] + "</h3>" 

according to firebug. 根据萤火虫。

I'm sure it's something obvious - hopefully your eyes will spot it where mine have failed! 我敢肯定这很明显-希望你的眼睛能在我失败的地方发现它!

您不是在该行中的这两个之间缺少+号吗?

res.DATA.CONTACTFIRSTNAME[i] res.DATA.CONTACTLASTNAME[i]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM