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

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Magento/PHP - Get phones on all members in a customer group -

session - Logging Out Using PHP -