Uncaught Syntaxerror: Unexpected Identifier

Asked

Viewed 13,243 times

1

Guys I’m having this error on line 14 of my script however I’m not able to see the error, if anyone can help, thank you!!

line 14 -> error:Function(date){

whole Cód

$(document).ready(function(){
function confLojas(id) {
   var resposta = confirm("Deseja realmente remover esse registro?");

   if (resposta == true) {
        $.ajax({
          type:'GET',
          url:'../php/deleteLojas.php',
          data:'id'+id,
          success:function(data){
            alert("Registro exluído com sucesso!");
            $("#"+id).hide();
          }
          error:function(data){ //linha 14
            alert("Erro!");
          }
        });
      }
  }

function confSites(id) {
   var resposta = confirm("Deseja realmente remover esse registro?");

   if (resposta == true) {
     $.ajax({
       type:'GET',
       url:'../php/deleteSites.php',
       data:'id'=id,
       success:function(data){
         alert("Registro exluído com sucesso!");
         $("#"+id).hide();
       }
       error: function(data){
         alert("Erro!");
       }
     });
   }
 }
});

1 answer

5


Foul the comma before the error, in both cases.

success:function(data){
    alert("Registro exluído com sucesso!");
    $("#"+id).hide();
},
error:function(data){ //linha 14
    alert("Erro!");
}
  • Thanks, that’s right! Thank you very much!

  • Just for the record: you can mark the answers to your questions as correct using the below the arrows to vote. I noticed that you have another question that did not accept answer, so I thought it was good to warn =D

  • Thanks, I’m new and I didn’t know it!

  • I figured. Welcome to [en.so]

  • Valeu jbueno :D

Browser other questions tagged

You are not signed in. Login or sign up in order to post.