Js splicing HTML note problem sample discussion

  • 2020-03-30 03:31:37
  • OfStack

What do you want others to do for you,
What is adress,


var hrf='<a href="javascript:;" rel="external nofollow" rel="external nofollow" onclick="window.open('+url+','','"height=625,width=830,toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no"')">'+adress+'</a>';

Adress [j] appears again below. The usage is completely wrong.


msg+='<tr style="height:25px"><td align ="left" style="width:6%;color:Black">'+coal[j]+'</td><td align ="left" style="width:8%;color:Black">'+url+hrf+'</td><td align ="left" style="width:24%;color:Black">'+adress[j]+'</td><td align ="left" style="width:12%;color:Green;font-weight :bold">'+ssz[j]+'</td>';

ask

I want to put


<a href="javascript:;" rel="external nofollow" rel="external nofollow" onclick="window.open('+url+','','"height=625,width=830,toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no"')">'+adress+'</a>

Put a single quotation mark on the outside of this sentence, but tried many times to be unsuccessful, this sentence put a single quotation mark, how to change inside

answer

Escape, \" = ", \' = '

ask

Escape character is not very good, can you give me a column

answer

Var zz = "< Tr style = \ "height: 25 px \" >" ;


Related articles: