0

This code throws SyntaxError: Unexpected token W. Why? And how to fix it?

      http({
          method: 'POST',          
          url: defaultUrl,
          data: $.param(newPlayer),.
          headers: {'Content-Type': 'application/x-www-form-urlencoded'}
      })

Thanks for answers.

2
  • Can you show the rest of your code? Commented Apr 13, 2015 at 6:00
  • There was bug in rest code, but now it is fixed. Commented Apr 13, 2015 at 6:02

1 Answer 1

1

There shouldn't be a dot after data. and "`" at the end. here it goes.

 http({
          method: 'POST',          
          url: defaultUrl,
          data: $.param(newPlayer),
          headers: {'Content-Type': 'application/x-www-form-urlencoded'}
      })
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.