Framework7 (Dom7): JSONP

Framework7 (Dom7): JSONP

我使用的是Fremework7 v1.4.0,文档中没有jsonpCallbackjsonp等相关的JSONP参数。只有 crossDomain: true 可用。

Framework7 (Dom7) 是否支持 JSONP 和回调参数 jQuery?

我使用了下面的代码但没有成功:

var $$ = Dom7;
$$.ajax({
    url: "http://query.yahooapis.com/v1/public/yql",
    contentType: "OPTIONS",
    crossDomain: true,
    data: {
        q: "select title,abstract,url from search.news where query=\"cat\"",
        format: "json"
    },
    success: function( response ) {
        alert( 'ok' );
        alert( response );
    }
});

我不知道这种方式是不是最好的方式,我遇到了同样的问题,这种方式适合我。

var $$ = Dom7;
$$.ajax({
    url: "http://query.yahooapis.com/v1/public/yql",
    contentType: "OPTIONS",
    dataType : 'json',
    crossDomain: true,
    data: {
        q: "select title,abstract,url from search.news where query=\"cat\"",
        format: "json",
        callback:function(){
           return true;
        }
    },
    success: function( response ) {
        alert( 'ok' );
        alert( response );
    }
});