有没有什么好的理由让javascript成为内联

编程入门 行业动态 更新时间:2024-10-15 00:21:08
本文介绍了有没有什么好的理由让javascript成为内联的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我一直在建网站。在某些阶段,我注意到IE显示有点坏了,Chrome除了身体标签(空)之外什么都没有呈现,而且FF看起来都很好。

I've been building a site. At some stage I noticed that IE display was a little broken and Chrome had all but rendered nothing but the body tag (empty), and FF all looked good.

投掷之后我的键盘在房间里,我的头靠在我的鼠标上,我发现了问题。我已离开(不要问如何或为什么,一定是闪电般的速度切割和粘贴错误)在内联脚本块中未公开的HTML注释。

After throwing my keyboard around the room and bashing my head against my mouse, I discovered the problem. I had left (don't ask how or why, must have been some lightning speed cut and paste error) an HTML comment unclosed in an inline script block.

<script type="text/javascript"> <!-- ... </script>

我猜测(未经测试)问题不会出现,或表现在如果脚本是外部的,则更加明显。所以无论如何,我想,有没有时间你有一个很好的理由来编写内联脚本?

I'm guessing (not tested) the problem would have either not come up, or manifested itself in a far more noticeable way if the script was external. So anyways, I got to thinking, is there ever a time when you have a really good reason to write inline script??

推荐答案

无。写下不引人注目的Javascript 。

更多推荐

有没有什么好的理由让javascript成为内联

本文发布于:2023-11-22 01:03:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1615363.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:内联   有没有什么   理由   javascript

发布评论

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

>www.elefans.com

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