Javascript 为什么分号会出现语法错误?

Javascript 为什么分号会出现语法错误?,javascript,jquery,syntax,flickr,Javascript,Jquery,Syntax,Flickr,此代码位不会产生任何错误: //if the image has tags if(data.photo.tags.tag != '') { //create an empty array to contain all the tags var tagsArr = new Array(); //for each tag, run this function $.each(data.photo.tags.tag, function(j, item){

此代码位不会产生任何错误:

//if the image has tags
if(data.photo.tags.tag != '') {

    //create an empty array to contain all the tags
    var tagsArr = new Array();

    //for each tag, run this function
    $.each(data.photo.tags.tag, function(j, item){

        //push each tag into the empty 'tagsArr' created above
        tagsArr.push('<a href="http://www.flickr.com/photos/tags/' + item._content + '">' + item.raw + '</a>');

    });

    //turn the tags array into a string variable
    //var tags = tagsArr.join(' ');
}
然后分号出现语法错误。我试图做的是删除标记的链接,只返回原始链接


感想&谢谢

如果您只想输出
项.raw
值,请执行以下操作:

tagsArr.push(item.raw);
你在试图增加一些价值。
tagsArr.push(item.raw);