可能重复:
转义双引号 javascript
如果这是一个愚蠢的问题,请原谅我,但是是否可以编写以下 javascript 而无需在 php、javascript 或 jquery 的任何地方实际使用 "?
var uagent = navigator.userAgent.toLowerCase();
if (uagent.search("iphone") > -1){
document.write("<img src=http://www.demiads.com/images/bc-1300119669-722.gif />"); }
else{
document.write("<object classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000
codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0 width=728 height=90 id=lang align=middle style=margin-left:3px;>
<param name=allowScriptAccess value=sameDomain />
<param name=allowFullScreen value=false />
<param name=movie value=http://koha.net//repository/reklamat/17_05_12_131575_koha.net_hej_reveal_675x88px.swf />
<param name=quality value=high />
<param name=bgcolor value=#ffffff />
<param name=wmode value=transparent />
<embed src=http://koha.net//repository/reklamat/17_05_12_131575_koha.net_hej_reveal_675x88px.swf
quality=high WMODE=transparent bgcolor=#ffffff width=728 height=90
name=ifm_al align=middle allowScriptAccess=sameDomain
allowFullScreen=false type=application/x-shockwave-flash
pluginspage=http://www.macromedia.com/go/getflashplayer />
</object>");
}