ok i have a string.
"<div class='down_arrow left_side'></div><div class='holder clearfix'><div class='topimg' style='background-image: url("+topimg+");'></div></div>";
and i need it to be like this
"<div class='down_arrow left_side'></div><div class='holder clearfix'><div class='topimg' style='background-image: url(' "+topimg+" ' );'></div></div>";
but the extra ‘ will close the style tag.
So how do you get past this?… Ive read a few posts like use \ before the quotes but it doesn’t really work.
just for some people
var friinfo = document.createElement("DIV");
friinfo.id = "friendsinfo";
friinfo.className = "friendsinfo";
friinfo.innerHTML = "<div class='down_arrow left_side'></div><div class='holder clearfix'><div class='topimg' style='background-image: url(\"+topimg+\");'></div></div>";
document.body.appendChild(friinfo);
This is the actual code
so Just to enforce the question, I want to get a extra layer of quotes in my string below
"<div class='down_arrow left_side'></div><div class='holder clearfix'><div class='topimg' style='background-image: url("+topimg+");'></div></div>";
so it will turn out to be this
"<div class='down_arrow left_side'></div><div class='holder clearfix'><div class='topimg' style='background-image: url(' "+topimg+" ' );'></div></div>";
with the quotes ‘
1 Answer