html – 在iframe srcdoc值中转义引号
发布时间:2020-12-14 18:56:35 所属栏目:资源 来源:网络整理
导读:根据 spec的报价必须转义,即代替: iframe seamless sandbox srcdoc="pYeah,you can see it a href="/gallery?mode=coveramp;page=1"in my gallery/a."/iframe 我们应该使用: iframe seamless sandbox srcdoc="pYeah,you can see it a href=quot;/gallery?m
根据
spec的报价必须转义,即代替:
<iframe seamless sandbox srcdoc="<p>Yeah,you can see it <a href="/gallery?mode=cover&page=1">in my gallery</a>."></iframe> 我们应该使用: <iframe seamless sandbox srcdoc="<p>Yeah,you can see it <a href="/gallery?mode=cover&amp;page=1">in my gallery</a>."></iframe> 但是在上面的例子中简单地使用单引号是不行的: <iframe seamless sandbox srcdoc="<p>Yeah,you can see it <a href='/gallery?mode=cover&page=1'>in my gallery</a>."></iframe> 解决方法
您链接的规范仅注意到引号被转义,因为
使用单引号没有问题,如上一个例子所示. 如果价值中有单引号(例如,“你是”),那么你必须逃避任何一个或另一个. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |