简体   繁体   中英

JSONP callback not working from this cinema url

I am trying to create a successfull jsonp call to this url: http://ws.cineplanet.cl:3080/sistemas/wscp?callback=?&florida_cartelera_fechas_horas

The strange thing is, when I use another url the callback works fine. Like this one: http://www.cinemark.cl/movies.json?callback= ? So it must be something server sided. But does anyone have a clue what it could be? I spend lot's of hours trying to make this work.. :(

Thanks in advance. This is the code that I used:

var jqxhr1 = $.ajax({
   url: "http://ws.cineplanet.cl:3080/sistemas/wscp?callback=?&florida_cartelera_fechas_horas", //this one does not work
   // url: "http://www.cinemark.cl/movies.json?callback=?", //this one works
   dataType: 'jsonp'
});

$.when(jqxhr1).done(function (jqxhr1) {
  console.log(jqxhr1);
});

Yes, it is server side.

It looks like that the http://ws.cineplanet.cl:3080/sistemas/wscp address doesn't support JSONP response.

If you check the address that works:

http://www.cinemark.cl/movies.json?callback=myCallback

You can see that the response JSON is wrapped in the myCallback function.

This doesn't seem to happen with the other URL:

http://ws.cineplanet.cl:3080/sistemas/wscp?florida_cartelera_fechas_horas&callback=myCallback

Some reading about JSONP: https://en.wikipedia.org/wiki/JSONP

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM