Basic JavaScript error

-2

Good morning guys, can you tell me why I'm getting the error

  

SyntaxError: missing) after argument list, at line 14 in the following code:

$(document).ready(function() {

      var $div_novospedidos = $('#div_novospedidos');
      $div_novospedidos.empty(); //Limpando a tabela
      // setTimeout(function(){ location.reload(); }, 5000);
      $.get("database3.php", function(data, status) {
          //if (data == null) {console.log("sem pedidos hoje")} else {console.log("teste")};
          var dados_pedido = data;
          console.log(dados_pedido);
          const obj = dados_pedido;
        }

        var dados = $.parseJSON(data); console.log(dados); $.each(dados, function(i, item) {
          numeroPedido = item.doc_number;
          nomeCliente = item.client_name;
          horarioPedido = item.clock;

          var newReq = $('<div class="panel panel-default col-6 col-lg-4 ">');
          var cols = "";

          cols += '<p>HORARIO: ' + horarioPedido + '</p></div>';
          cols += '<p>PEDIDO: ' + numeroPedido + '</p></div>';
          cols += '<p>Cliente: ' + nomeCliente + '</p></div>';

          newReq.append(cols);

          $("#div_novospedidos").append(newReq);

        });
      }
    
asked by anonymous 27.09.2017 / 17:11

1 answer

0

You have missed closing the section where you make $.get('database3.php', function (data, status) { .

Just add the ) before the snippet that has var dados . It is also necessary to close with the ) the last line, that is, after the last } of the function used in $(document).ready(function () { ;

I suggest using some IDE that you can, in real time, check the syntax errors, to avoid time loss or embarassment like this.

I found it easy to be using VS Code.

See:

    
27.09.2017 / 17:31