B
B
batraider2016-07-16 20:43:37
PHP
batraider, 2016-07-16 20:43:37

What is wrong with JSONP request?

I'm trying to send a request to the VK api, via Long Polling, I use JSONP for cross-platform.
All data is received successfully (see screenshot), but the following error is generated:
Uncaught SyntaxError: Unexpected token : What 's wrong

?

(function() {
    var server = 'imv4.vk.com/im6769';
    var key = '7296c8b6ca7a357540e98eea17d4bcdc7b831c94';
    var ts = 1710680601;

  var poll = function() {
     $.ajax({
     	  url: 'https://'+server+'?act=a_check&key='+key+'&ts='+ts+'&wait=25&mode=8&access',
     	  dataType: 'jsonp',
     	  crossDomain: true,
     	  type: 'GET'
     });
  };
   setInterval(function() {
        poll();
   }, 2000);

})()


f4837c46462b435394039f22dc3bbd93.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SagePtr, 2016-07-17
@SagePtr

I can assume that the server does not support jsonp (ignores the callback parameter and does not wrap the object in a function call)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question