[英]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 我正在尝试对此URL创建成功的jsonp调用: 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. 奇怪的是,当我使用另一个URL时,回调工作正常。 Like this one: http://www.cinemark.cl/movies.json?callback= ? 像这样的一个: 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. 看起来http://ws.cineplanet.cl:3080/sistemas/wscp地址不支持JSONP响应。
If you check the address that works: 如果您检查有效的地址:
http://www.cinemark.cl/movies.json?callback=myCallback http://www.cinemark.cl/movies.json?callback=myCallback
You can see that the response JSON is wrapped in the myCallback function. 您可以看到,响应JSON包装在myCallback函数中。
This doesn't seem to happen with the other URL: 其他网址似乎没有发生这种情况:
http://ws.cineplanet.cl:3080/sistemas/wscp?florida_cartelera_fechas_horas&callback=myCallback http://ws.cineplanet.cl:3080/sistemas/wscp?florida_cartelera_fechas_horas&callback=myCallback
Some reading about JSONP: https://en.wikipedia.org/wiki/JSONP 关于JSONP的一些阅读: https : //en.wikipedia.org/wiki/JSONP
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.