我一直在建网站。在某些阶段,我注意到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成为内联
发布评论