小编Ane*_*eez的帖子

请求的资源错误上没有"Access-Control-Allow-Origin"标头

我正在尝试获取新闻网站的Feed.我以为我会使用google的feed API将feedburner Feed转换为json.以下网址将以json格式从Feed返回10个帖子.http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=10&q=http://feeds.feedburner.com/mathrubhumi

我使用以下代码来获取上面的url的内容

$.ajax({
  type: "GET",
  dataType: "jsonp",
  url: "http://ajax.googleapis.com/ajax/services/feed/load",
  data: {
    "v": "1.0",
    "num": "10",
    "q": "http://feeds.feedburner.com/mathrubhumi"
  },
  success: function(result) {
    //.....
  }
});
Run Code Online (Sandbox Code Playgroud)

但它没有工作,我收到以下错误

XMLHttpRequest无法加载 http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=10&q=http%3A%2F%2Ffeeds.feedburner.com%2Fmathrubhumi.请求的资源上不存在"Access-Control-Allow-Origin"标头.原产地" :HTTP //本地主机,因此"是不允许访问.

我该如何解决?

javascript ajax jquery json cors

89
推荐指数
3
解决办法
44万
查看次数

从完整日历中获取点击日期

单击fullcalendar上的日期 启动模式'#view_event'.我想知道我点击的日期.每个日期都有".fc-day"类,其属性为data-date ="2015-02-13".所以我尝试了以下内容.

$(".fc-day").click(function(){
    var fetchDate = $(this).data("date");
    $("#displayDate").text(fetchDate);
});
Run Code Online (Sandbox Code Playgroud)

'#displayDate'是模态中的ap元素.上面的代码不起作用.怎么了?

javascript jquery fullcalendar

1
推荐指数
1
解决办法
2万
查看次数

标签 统计

javascript ×2

jquery ×2

ajax ×1

cors ×1

fullcalendar ×1

json ×1