我可以放置< script>< / script>里面< script>< / script&

编程入门 行业动态 更新时间:2024-10-28 14:34:08
本文介绍了我可以放置&lt; script&gt;&lt; / script&gt;里面&lt; script&gt;&lt; / script&gt;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 所以我需要在一些脚本标签中加载一个包含在一组脚本标签中的广告是否可能? 当你使用< script> HTML标记时,里面的内容被视为带引号(字面)的字符串,所以内部< / script> 标签里面被视为结束标签而不是字符串的一部分。所以你不能直接在脚本部分使用标签。

如果你必须,user2310289的方法是有效的,或者你也可以使用字符串连接 - 例如: < / sc+ript>);

So I need to load a advert contained in a set of script tags inside some script tags is it possible ?

解决方案

When you use a <script> HTML tag what is inside is treated as a quoted (literal) string, so the inner </script> tag inside is treated as a closing tag rather than as a portion of the string. So you cannot directly use the tag inside a script section.

If you must, user2310289's approach is valid or you could also use string concatenation - eg: "</sc"+"ript>");

更多推荐

我可以放置&lt; script&gt;&lt; / script&gt;里面&lt; script&gt;&a

本文发布于:2023-09-07 18:43:29,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:lt   amp   gt   script

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!