mardi 5 mai 2015

Include HTML/PHP in JS variable

I have the following JS code:

{var c;a.stores=[{name:"Nijiya Market",price:"$$",sales:292,rating:4},{name:"Eat On Monday Truck",price:"$",sales:119,rating:4.3}]

I call on these variables to produce an html table. What I want to do is use html within the JS variable to produce an image instead of text. So for example:

{var c;a.stores=[{name:"<img src='url'>",price:"$$",sales:292,rating:4},{name:"<img src='url'>",price:"$",sales:119,rating:4.3}]

Can anyone suggest how I do this and if the same method would work with php.

Don't know if it matters, but I am using AngularJS.

Thanks.

Aucun commentaire:

Enregistrer un commentaire