S
S
shnicel2015-12-12 20:00:27
JavaScript
shnicel, 2015-12-12 20:00:27

Error in the answer, what the hell?

Hello everyone, I'm making an ajax request.

<script type="text/javascript">
    $.ajax({
      url : 'https://oauth.vk.com/access_token?client_id=517*****&client_secret=****A3yQqNU7HRaAX8QJ&v=5.41&grant_type=client_credentials',
      type : "GET",
      dataType : "jsonp",
      success : function(data){
          console.log(data);
      }
    });
  </script>

what in the console I get the error "Uncaught SyntaxError: Unexpected token:". I click on it and there {"access_token":"87315073873150738781b3c863877e584a887318735d011bc2ae4522ed037b53","expires_in":0} my token received how to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2015-12-12
@Rsa97

oauth.vk.com returns a response in JSON, not JSONP.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question