问题描述
有时候,当我将jsfiddle中的javascript复制到Dreamweaver中时,我最终会撞墙。两个(看上去是)完全相同的javascript的文档不能以相同的方式工作。
在AI文件中具有以下代码:
< script>
警报(测试)
< / script>
文档BI中的代码如下(无效):
< script>
警报(测试)
注意:请在将代码B复制到html文档中之前,先试一下它是否发出警报。我不是在开玩笑,发生了一些奇怪的事情。
我已经确定问题出在结尾脚本标签上,但是我看不到任何错误
文档A和B中的代码有什么区别?
您有一个(U + 8203 )。
错误,这似乎与语法突出显示工具有关。 / p>
Sometimes when I copy javascript from jsfiddle into Dreamweaver I end up banging my head in the wall. Two documents with (what looks to be) the EXACT same javascript doesn't work in the same way.
In document A I have the following code:
<script>
alert('test')
</script>
In document B I have the following code (does not work):
<script>
alert('test')
</script>
Note: Please copy code B in to a html document and try if it alert before giving me comments. I am not joking, there is something weird going on.
I have located the problem to be something with the end script tag, but I can't see any thing wrong with the code.
Whats the difference in the code from document A and B?
You've got an Zero-width space (U+8203) behind the closing bracket.
The bug is known to jsfiddle, it seems to be an issue with the codemirror syntax highlighter.
这篇关于完全相同的代码无法在Dreamweaver中正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!