0

Im trying to build a ajax call using some $post data that require the score separator and always face an issue of wrong syntax.

    $.ajax({
        url: "register.php",
        type: "post",
        cache: false,
        dataType: 'json',
        data: { 
            register-username: name,
            register-email: email,
        },
        success: function(response) {
        },
        error: function(){
        }
    });

i wonder how i can use those register-username and register-email without having a syntax error. Changing those for no separator is not an option.

Mireille28
  • 337
  • 5
  • 13

1 Answers1

1

Use quotes

 data: { 
   "register-username": name,
   "register-email": email,
 },
Zerowiel
  • 170
  • 7