简体   繁体   English

未捕获的SyntaxError:意外令牌}

[英]Uncaught SyntaxError: Unexpected token }

Got something strange here. 在这里有奇怪的事情。 I got the error "Uncaught SyntaxError: Unexpected token } " And Chrome mentions the problem in this line: 我收到错误消息“ Uncaught SyntaxError:Unexpected token}”,Chrome在这一行中提到了该问题:

<html>

And i do not see any problem here. 而且我在这里看不到任何问题。 My code is here: 我的代码在这里:

<script type="text/javascript">
<!--
var zaehler = 0;

function plus()
{
    document.getElementById("table_dienstleistungen").innerHTML += "<table rules=\"all\" width=\"100%\" style=\"border:1px black solid; margin-bottom: 10px;\"><tr><td>Dienstleistung:</td><td align=\"right\"><input size=\"20\" name=\"textfeldname[]\" type=\"text\" onBlur=\"document.getElementById(\"dienstleistungen-" + zaehler +"\").value=this.value\"></td></tr><tr><td>Stundenlohn in /Std:</td><td align=\"right\"><input size=\"5\" name=\"stundenlohn[]\" type=\"text\"></td></tr></table>";
    document.getElementById("hidden_infos").innerHTML += "<div id=\"save-" + zaehler + "\"><table rules=\"all\" width=\"100%\" style=\"border:1px black solid; margin-bottom: 10px;\"><tr><td>Dienstleistung:</td><td align=\"right\"><input id =\"dienstleistungen-" + zaehler + "\" size=\"20\" name=\"textfeldname[]\" type=\"text\"></td></tr><tr><td>Stundenlohn in /Std:</td><td align=\"right\"><input size=\"5\" name=\"stundenlohn[]\" type=\"text\"></td></tr></table></div>";
    zaehler ++;
}

function minus()
{
    zaehler --;
    document.getElementById("table_dienstleistungen").innerHTML = "";
    document.getElementById("save-"+zaehler).innerHTML = "";
    for(var zahl=0; zahl <= zaehler; zahl++){
        document.getElementById("table_dienstleistungen").innerHTML += document.getElementById("save-"+zahl).innerHTML;
    }
}
//-->
</script>

This code is Included in my main page via "Include" from a seperate HTML Document. 该代码通过单独的HTML文档中的“包含”包含在我的主页中。

This is invalid Javascript 这是无效的Javascript

<!--

This is simply a comment 这只是一条评论

//-->

Probably removing the first line will solve your issue. 可能删除第一行将解决您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM