0
我想用Flot绘制图表。数据存储在我的数据库(MongoDB)和Flot正在呈现在JS中 - 所以我需要以某种方式将数据从我的控制器传递给Javascript,以便将此数据提供给Flot。我试着与FosRestBundle一个宁静的API,但是当我试图从的document.ready JavaScript调用它,我得到了以下错误:Symfony2 - 如何在JS中正确访问数据库中的数据(通过控制器)以便使用Flot?
XMLHttpRequest cannot load localhost:8000/ajax/loginsperday.
Cross origin requests are only supported for protocol schemes:
http, data, chrome, chrome-extension, https, chrome-extension-resource.
什么是绘制图表的最有效和最适当的方式Flot(JS)使用来自数据库的数据(由Doctrine ODM管理的MongoDB)?
如何打开Flot页面?看看http://stackoverflow.com/questions/10752055/cross-origin-requests-are-only-supported-for-http-error-when-loading-a-local寻求灵感。 –