vivi94
vivi94

Reputation: 55

Uncaught SyntaxError : missing ) after argument list in my code

I have stange error, I don't understand why my images can't display.

    echo "<div id='img' style='height':200px;'width':200px></div>";

echo "<script type='text/javascript'>
                        var tab_nb_match_par_user = ".json_encode($tab_nb_match_par_user).";    
                        //chart 1
                        var line1 = [];
                        for (var k in tab_nb_match_par_user) {
                             line1.push([k, tab_nb_match_par_user[k]/2]);
                        }
                        var taille = 70;     
                        for (var k in tab_nb_match_par_user){
                            $('#img').append('<img src='stats_matching/' + k + '.gif' alt=' + k + ' title=' + k + ' width=' + taille + ' />');
                            taille = taille-6;
                        }</script>";

Upvotes: 0

Views: 295

Answers (1)

Miguel M.
Miguel M.

Reputation: 421

You had quotes where you shouldn't have. You don't need quotes around css properties inside the style tag.

echo "<div id='img' style='height:200px;width:200px;'></div>";

Upvotes: 1

Related Questions