SyntaxError:缺少形式参数 [英] SyntaxError: missing formal parameter

查看:304
本文介绍了SyntaxError:缺少形式参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的代码有一些错误。也许有人可以帮助我。我得到这个错误:

  SyntaxError:缺少形式参数
function col(10,10) {

这是我的代码:

 < script type =text / javascript> $(<?= $ result ['seats_count']?>,<?= $ result ['booked']?>){
if((<?= $结果['seats_count']?>><?= $ result ['booked']?>))$('。table.table-bordered.booking tbody tr')。css(background-color , #F55);
};
< / script>


解决方案

A FormalParameterList 是以逗号分隔的 Indentifier 标记



标识符只能开始使用 IdentifierStart


IdentifierStart ::




  • UnicodeLetter



  • _

    \\ UnicodeEscapeSequence


  • $ b

    标识符不能以数字开头,因此 10 不是有效的形式参数。在创建您的 col 函数代码时,您的PHP代码必须生成正式参数名称,每个名称以字母开头(或其他有效开始字符,如上所示)。 p>

    I have some errors with my code. Maybe someone could help me. I am getting this error:

    SyntaxError: missing formal parameter
    function col(10,10){
    

    And this is my code:

    <script type="text/javascript">
       function col(<?=$result['seats_count']?>,<?=$result['booked']?>){
           if((<?=$result['seats_count']?>><?=$result['booked']?>))$('.table.table-bordered.booking tbody tr').css("background-color","#f55");
       };
    </script>
    

    解决方案

    A FormalParameterList is a comma-separated list of Indentifier tokens.

    Identifiers can only begin with an IdentifierStart:

    IdentifierStart ::

    • UnicodeLetter

    • $

    • _

    • \ UnicodeEscapeSequence

    Identifiers cannot begin with a number, so 10 is not a valid formal parameter. In creating your col function code, your PHP code must produce formal parameter names that each begin with a letter (or one of the other valid beginning characters, as above).

    这篇关于SyntaxError:缺少形式参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆