简体   繁体   English

为什么我的jQuery Feeds插件不起作用?

[英]Why won't my jQuery Feeds plugin work?

This plugin should display RSS feeds in jQuery, but I'm not getting any output following the docs . 这个插件应该在jQuery中显示RSS feed,但是在docs之后我没有得到任何输出。

HTML: HTML:

<div id="feeds"></div>

jQuery jQuery的

$('#feeds').feeds({
    feeds: {
        feed1: 'http://rollingstonesofficial.tumblr.com/rss'
    }
});

Here it is in action: http://jsfiddle.net/XmY9d/30/ 它在起作用: http : //jsfiddle.net/XmY9d/30/

Is there somethign I'm missing? 有没有我想念的东西?

UPDATE 1 更新1

Thanks for your responses guys. 谢谢你们的回答。 I should say that this problem also occurs locally in a Chrome extension. 我应该说这个问题也在Chrome扩展程序中本地发生。

UPDATE 2 更新2

These are the errors I get in the console: 这些是我在控制台中得到的错误:

Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' chrome-extension-resource:".

Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' chrome-extension-resource:".

Both occur in jquery.feeds.min.js on line 17. 两者都发生在第17行的jquery.feeds.min.js中。

You cannot load file from raw.github.com in jsFiddle . 您无法从raw.github.com中的jsFiddle加载文件。

So, instead of including your plugin through raw Github, you can use 因此,您可以使用以下方法,而不是通过原始的Github包含插件:

<script src="http://camagu.github.io/jquery-feeds/jquery.feeds.js"></script>

or you can put it directly inside Javascript panel. 或者您可以将其直接放在Javascript面板中。

Updated Fiddle 更新小提琴

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM