【发布时间】:2015-04-05 12:22:23
【问题描述】:
我不知道为什么我的网络浏览器会在我的网站上返回“SyntaxError: Unexpected EOF”错误。我没有进行任何更改,但必须更改一些内容,因为昨天同一站点运行良好。
这是我的源代码(直接来自 FTP 服务器):
<script type="">
$(function(){
$("body").append("<div class='tooltip2_showv' id='tooltip2_show'></div>");
$('a.button.notactive').mousemove(function(e){
$('#tooltip2_show').html( $('.popup',$(this)).html());
$('#tooltip2_show').show();
$('#tooltip2_show').css({'top': e.pageY + 5, left: e.pageX + 5,'position': 'absolute'});
}).mouseout(function(){
$('#tooltip2_show').hide();
});
});
</script>
看起来不错,但从 Web 浏览器(Web Inspector)检查相同的代码:
<script type="">
$(function(){
$("body").append("<div class='tooltip2_showv' id='tooltip2_show'></script></div>");
$('a.button.notactive').mousemove(function(e){
$('#tooltip2_show').html( $('.popup',$(this)).html());
$('#tooltip2_show').show();
$('#tooltip2_show').css({'top': e.pageY + 5, left: e.pageX + 5,'position': 'absolute'});
}).mouseout(function(){
$('#tooltip2_show').hide();
});
});
脚本标签的结尾位置错误!你知道为什么吗? 这不是唯一错误放置的“脚本结尾”标签。
复活节快乐;)
【问题讨论】:
-
只使用
-
@Zet 也许你有一个与脚本混淆的扩展?
标签: javascript html web tags