散景内嵌,'Failed to load resource'
Bokeh Inline Embedding, 'Failed to load resource'
我在嵌入 Bokeh 时遇到问题。特别是,从 'link' 标记加载资源时存在问题(请参阅下面的 html 代码段)。出于某种原因,当我尝试内联嵌入散景图时,出现以下错误:'Failed to load resource: the server responded with a status of 404 (Not Found)',引用此 link - https://cdn.bokeh.org/bokeh/release/bokeh.min.css.map
不过,上面的地址和我在link标签里写的地址不一样(省略了末尾的bokeh版本)。我不知道为什么会出现此错误,这是第一次发生这种情况。我以前曾多次成功使用内联嵌入。
<head>
<link href="https://cdn.bokeh.org/bokeh/release/bokeh-0.12.1.min.css" rel="stylesheet" type="text/css">
<script src="https://cdn.bokeh.org/bokeh/release/bokeh-0.12.1.min.js>
</script>
</head>
编辑
我正在尝试将内联嵌入与 jQuery 一起使用(我想显示不同的散景图,而无需每次都重新加载整个页面)。
当我在控制台中查找更多错误详细信息时,我发现了以下错误:"Error rendering Bokeh model: could not find tag with id..."
如果有任何相关性,这里是我 html 中的 jQuery 脚本:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type=text/javascript>
$(function() {
$('a#process_input').bind('click', function() {
$.getJSON('/background_process', {
proglang: $('input[name="proglang"]').val(),
}, function(data) {
$("#result").html(data.a);
$("#r").html(data.b);
});
return false;
});
});
</script>
其中 'data.a' 和 'data.b' 分别是 Bokeh 生成的脚本和 div 标签。
如有任何建议或建议,我们将不胜感激!
最好的猜测是脚本正在执行 first/early,然后 <div>
被插入 DOM。您将需要找到一种方法来保证 <div>
在脚本执行时可用。
顺便说一句,创建 componenent
函数时并没有真正设想到部分加载用例。如果您想进行部分加载,最好提供文档 JSON,然后调用 Bokeh.embed.embed_items
directly on from JavaScript somehow. But it would probably take some experimentation and discussion and back and forth to get that working, which SO is not very good for. I'd encourage you you bring this topic to the public Discourse 进行进一步讨论。
我在嵌入 Bokeh 时遇到问题。特别是,从 'link' 标记加载资源时存在问题(请参阅下面的 html 代码段)。出于某种原因,当我尝试内联嵌入散景图时,出现以下错误:'Failed to load resource: the server responded with a status of 404 (Not Found)',引用此 link - https://cdn.bokeh.org/bokeh/release/bokeh.min.css.map
不过,上面的地址和我在link标签里写的地址不一样(省略了末尾的bokeh版本)。我不知道为什么会出现此错误,这是第一次发生这种情况。我以前曾多次成功使用内联嵌入。
<head>
<link href="https://cdn.bokeh.org/bokeh/release/bokeh-0.12.1.min.css" rel="stylesheet" type="text/css">
<script src="https://cdn.bokeh.org/bokeh/release/bokeh-0.12.1.min.js>
</script>
</head>
编辑
我正在尝试将内联嵌入与 jQuery 一起使用(我想显示不同的散景图,而无需每次都重新加载整个页面)。
当我在控制台中查找更多错误详细信息时,我发现了以下错误:"Error rendering Bokeh model: could not find tag with id..."
如果有任何相关性,这里是我 html 中的 jQuery 脚本:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type=text/javascript>
$(function() {
$('a#process_input').bind('click', function() {
$.getJSON('/background_process', {
proglang: $('input[name="proglang"]').val(),
}, function(data) {
$("#result").html(data.a);
$("#r").html(data.b);
});
return false;
});
});
</script>
其中 'data.a' 和 'data.b' 分别是 Bokeh 生成的脚本和 div 标签。
如有任何建议或建议,我们将不胜感激!
最好的猜测是脚本正在执行 first/early,然后 <div>
被插入 DOM。您将需要找到一种方法来保证 <div>
在脚本执行时可用。
顺便说一句,创建 componenent
函数时并没有真正设想到部分加载用例。如果您想进行部分加载,最好提供文档 JSON,然后调用 Bokeh.embed.embed_items
directly on from JavaScript somehow. But it would probably take some experimentation and discussion and back and forth to get that working, which SO is not very good for. I'd encourage you you bring this topic to the public Discourse 进行进一步讨论。