K
K
Kirill Ushakov2016-07-12 13:25:39
JavaScript
Kirill Ushakov, 2016-07-12 13:25:39

Ajax. Where is the mistake?

I can't figure out where the error is. I did this 100500 times and everything worked, and then suddenly it gives out

common.js:4 Uncaught SyntaxError: Unexpected token :

The code itself
var $form = $('#reg').serialize();
$.ajax(function() {
  url: 'app/helper/auth.help.php',
  method: 'POST',
  data: $form,
  success: function(data) {
    console.log(data);
  },
  error: function (xhr, status, error) {}
});

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Дмитрий Беляев, 2016-07-12
@Bellicus

var $form = $('#reg').serialize();
$.ajax({
  url: 'app/helper/auth.help.php',
  method: 'POST',
  data: $form,
  succes: function(data) {
    console.log(data);
  },
  error: function (xhr, status, error) {}
});

S
Sergey, 2016-07-12
@baskserg

succes: function(data) {

Правильно будет: success

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question