2011-02-20 21 views
1

このビットは、すべてのエラーを生成しません:セミコロンで構文エラーが発生するのはなぜですか?コードの

//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(' '); 
} 

しかし、私は、タグ・アレイ・プッシュ回線を変更する場合:

//push each tag into the empty 'tagsArr' created above 
    tagsArr.push(+ item.raw +);          
}); 

その後、私はセミコロンの構文エラーを取得します。私がしようとしているのは、タグ付きのリンクを削除し、生のリンクだけを返すことです。

思考&ありがとう!

+0

あなたは、いくつかの値に* *括弧を追加しようとしています。 – delnan

答えて

2

あなただけの出力にitem.raw値をしたい場合の対処:

tagsArr.push(item.raw); 
関連する問題