I am trying to create a Bootstrap card with jquery. Everything is working except the "img".
This code works in the scala.html file but not in the html files:
<img src="@routes.Assets.versioned("images/friend_request.png")" width="28" height="22" />
This code doesn't work in the javascript file:
var createCard = $('<div class="col-md-4"><div class="card"><div class="card-body"><img src="@routes.Assets.versioned("images/friend_request.png")" width="28" height="22" /></div></div>')
$(".box" ).append(createCard);
I found a way to solve this problem, not sure if thats the best way tho.
This code works:
var createCard = $('<div class="col-md-4"><div class="card"><div class="card-body"><img src="/assets//images/friend_request.png" width="28" height="22" /></div></div>')
$(".box" ).append(createCard);