javascript - mui develops NetEase Cloud Music, the request interface is always cross-domain
学习ing
学习ing 2017-06-12 09:29:21
0
5
847
/***************************************************************
 *                                                             *
 * mui.ajax获取数据                                                                                                                   *
 *                                                             *
/***************************************************************/
var url = 'http://s.music.163.com/search/get/';
mui.ajax(url, {
    data: {
        'type': 1,
        's': '喜欢你',
        'limit': 10
    },
    dataType: 'json',
    type: 'post',
    timeout: 10000,
    success: function(response) {
        console.log(JSON.stringify(response))
    },
    error: function(xhr, type, errorThrown) {
        console.log(type)
    }

})

When I practice using segmentfault’s mui tutorial, a cross-domain error is always reported when opening the browser. Is it because the interface cannot be used? Or is it for other reasons

学习ing
学习ing

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!