jquery - Problems with using img src through JavaScript -
i have simple problem. getting carinfo data json file can't img source part variable $imgsrc instead of parsing string called "$imgsrc". appending html code.
var $imgsrc = "images/vehicles/" + carinfo[i].smallimage; var $container = .... + '<img src = '$imgsrc'>' + ....; $('body').append($container); edit:
+ ... '<img src = "images/vehicles/ + '$imgsrc'">' + ... this gives me error due opening single quote of $imgsrc closing single quote in beginning of tag
shouldnt this:
var $container = .... + '<img src = '+ $imgsrc +'>' + ....;
Comments
Post a Comment