在MeteorJS中获取外部网站的元描述

时间:2016-07-06 14:20:07

标签: javascript http meteor

我正在构建一个应用程序,我打算在输入URL后获取网站的描述,比如该网站的内容摘要。我该怎么做?

我尝试使用http Meteor包,如下所示:

HTTP.call('GET', url, {}, function (error, response) {
  if (error) {
    console.log(error);
  } else {
    console.log(response);
  }
 });

我收到以下错误:

XMLHttpRequest cannot load https://docs.meteor.com/api/http.html. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access.

是因为我在本地开发吗?或者http包仅限于JSON数据?我对JS和API一般都很陌生,所以任何帮助都会受到赞赏。

0 个答案:

没有答案