Hi I need to change this string in double quotes but I am not getting how to do
Right Now it is like
"<iframe src='"+urlSrv+'&embedded=true'+ "' frameborder='0' scrolling='auto' width='100%' height='100%'></iframe>"
and output is
<iframe src='http://localhost:46030/Login/Appointment%20Booking/Home.aspx?clhid=717c043d-126f-4f57-910b-247a83d58801?embedded=true' frameborder='0' scrolling='auto' width='100%' height='1000'></iframe>
but I need to make it as
<iframe src="http://localhost:46030/Login/Appointment%20Booking/Home.aspx?clhid=717c043d-126f-4f57-910b-247a83d58801&embedded=true" frameborder="0" scrolling="auto" width="100%" height="1000"></iframe>
the below script where I am Converting it
dvContSrvBtnCopy.className = "col-lg-2 col-md-2 col-sm-2 col-xs-2 padddiv";
dvContSrvBtnCopy.style.marginTop = "-2rem";
var pre = document.createElement('pre');
pre.className = 'precode';
var code = document.createElement('code');
if (type == "ServiceCatg") {
code.id = "txtFrameSrv_" + i;
code.innerHTML = '<iframe src="'+urlSrv+'&embedded=true'+ '" frameborder="0" scrolling="auto" width="100%" height="1000" ></iframe>';
}
pre.appendChild(code);
dvContSrv.appendChild(pre);
var btnCopy = document.createElement("button");
btnCopy.className = 'btnCOPYOnlineBkDynamic';
btnCopy.type = "button";
if (type == "ServiceCatg") {
btnCopy.id = "btnCopySrv_" + i;
btnCopy.setAttribute('onclick', "StaffSrvCrclCopy('" + btnCopy.id + "','ServiceCatg',true);");
}
var spnCopy = document.createElement("span");
spnCopy.className = 'copyDOOnlineBk';
btnCopy.appendChild(spnCopy);
dvContSrvBtnCopy.appendChild(btnCopy);
Does this solve your problem?
'<iframe src="' + urlSrv + '" frameborder="0" scrolling="auto" width="100%" height="1000"></iframe>'
I find it easiest to read HTML embedded in Javascript by wrapping it in single quotes, you can continue to use double quotes as normal in your HTML.
If you need to use single quotes in the html, you can escape them like this:
\'