我一直在尝试从此 API 获取移动链接,但没有成功
.done(function( data ) {
var ol = $("<ol/>");
$.each( data.headlines, function(h_key, headlines) {
var h2 = $( "<h2/>" ).append(headlines.headline);
var a = $( "<a/>" ).attr("href", headlines.links.mobile);
ol.append(h2)
ol.append(a)
这是我试图从中获取链接的响应正文
{
"timestamp": "2013-10-21T14:50:18Z",
"resultsOffset": 0,
"status": "success",
"resultsLimit": 10,
"resultsCount": 27,
"headlines": [{
"headline": "Portugal land Sweden in playoff draw",
"keywords": ["UEFA WCQ: Portugal land Sweden in playoff draw"],
"lastModified": "2013-10-21T14:17:13Z",
"audio": [],
"premium": false,
"mobileStory": "",
"links": {
"api": {
"news": {
"href": "http://api.espn.com/v1/sports/news/1588808?region=GB"
}
},
"web": {
"href": "http://espnfc.com/news/story/_/id/1588808/portugal-land-sweden-playoff-draw?ex_cid=espnapi_public"
},
"mobile": {
"href": "http://m.espn.go.com/soccer/story?storyId=1588808&ex_cid=espnapi_public"
}
},