jQuery的AJAX:无效的标签 [英] Jquery ajax: Invalid label

查看:106
本文介绍了jQuery的AJAX:无效的标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的code:

$.ajax({
        url: 'http://tinysong.com/b/Beethoven?format=json&key=<my key..>',
        dataType: 'jsonp',
        success: function(response) {
            console.log(response);
        }
    });

萤火虫说:无效的标签。但是,当我访问的网址在浏览器中,我看到:

Firebug says "invalid label". But when i visit the url in my browser, i see:

{"Url":"http:\/\/tinysong.com\/7Wm7","SongID":8815585,"SongName":"Moonlight Sonata","ArtistID":1833,"ArtistName":"Beethoven","AlbumID":258724,"AlbumName":"Beethoven: Piano Sonatas"}

看起来像一个corret JSON字符串给我。我失去了一些东西?谢谢!

Looks like a corret json-string to me. Am i missing something? Thanks!

推荐答案

这是JSON。你问一个JSONP字符串中的数据类型时,这将需要您的输出被包裹在一个函数。

That's JSON. You're asking for a JSONp string in the dataType, which would require your output to be wrapped in a function.

这篇关于jQuery的AJAX:无效的标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆