我一直在尝试使用散景服务器来获取通过https网站提供的互动图。我使用autoload_server生成的脚本从服务器中提取图。但是,我遇到了从散景服务器获取的autoload.js文件将css / js文件的http版本注入脚本的问题。
有没有办法避免散景服务http内容以避免内容混合错误?更好的是,是否可以配置散景以通过https提供内容?
谢谢!
(function(global) {
function now() {
return new Date();
}
if (typeof (window._bokeh_onload_callbacks) === "undefined") {
window._bokeh_onload_callbacks = [];
}
function run_callbacks() {
window._bokeh_onload_callbacks.forEach(function(callback) { callback() });
delete window._bokeh_onload_callbacks
console.info("Bokeh: all callbacks have finished");
}
function load_libs(js_urls, callback) {
window._bokeh_onload_callbacks.push(callback);
if (window._bokeh_is_loading > 0) {
console.log("Bokeh: BokehJS is being loaded, scheduling callback at", now());
return null;
}
if (js_urls == null || js_urls.length === 0) {
run_callbacks();
return null;
}
console.log("Bokeh: BokehJS not loaded, scheduling load and callback at", now());
window._bokeh_is_loading = js_urls.length;
for (var i = 0; i < js_urls.length; i++) {
var url = js_urls[i];
var s = document.createElement('script');
s.src = url;
s.async = false;
s.onreadystatechange = s.onload = function() {
window._bokeh_is_loading--;
if (window._bokeh_is_loading === 0) {
console.log("Bokeh: all BokehJS libraries loaded");
run_callbacks()
}
};
s.onerror = function() {
console.warn("failed to load library " + url);
};
console.log("Bokeh: injecting script tag for BokehJS library: ", url);
document.getElementsByTagName("head")[0].appendChild(s);
}
};var element = document.getElementById("976c2ae5-68de-4787-815c-852a1de3e3b0");
if (element == null) {
console.log("Bokeh: ERROR: autoload.js configured with elementid '976c2ae5-68de-4787-815c-852a1de3e3b0' but no matching script tag was found. ")
return false;
}var js_urls = ['http://website.com/static/js/bokeh.min.js?v=b0e2720e424bae5562ceecc6d83c2044', 'http://website.com/static/js/bokeh-widgets.min.js?v=8e88133dddc48883a815d4278dd80f9a', 'http://website.com/static/js/bokeh-compiler.min.js?v=34cb81b761c2c28f1955c7bb98dab3a9'];
var inline_js = [
function(Bokeh) {
Bokeh.set_log_level("info");
},
function(Bokeh) {
Bokeh.$(function() {
var docs_json = null;
var render_items = [{"sessionid": "nZqXOULM3zcQBaz1GDCOTLVIoa4a0UrlJIMzGCMzCTZk", "elementid": "976c2ae5-68de-4787-815c-852a1de3e3b0", "use_for_title": true}];
Bokeh.embed.embed_items(docs_json, render_items, "ws://website.com/ws");
});
},
function(Bokeh) {
console.log("Bokeh: injecting CSS: http://website.com/static/css/bokeh.min.css?v=486d3195473d3e39ad36f2888fefe389");
Bokeh.embed.inject_css("http://website.com/static/css/bokeh.min.css?v=486d3195473d3e39ad36f2888fefe389");
console.log("Bokeh: injecting CSS: http://website.com/static/css/bokeh-widgets.min.css?v=0bbd11cf0fab2f648f3918c073bc9c3d");
Bokeh.embed.inject_css("http://website.com/static/css/bokeh-widgets.min.css?v=0bbd11cf0fab2f648f3918c073bc9c3d");
}
];
function run_inline_js() {
for (var i = 0; i < inline_js.length; i++) {
inline_js[i](window.Bokeh);
}
}
if (window._bokeh_is_loading === 0) {
console.log("Bokeh: BokehJS loaded, going straight to plotting");
run_inline_js();
} else {
load_libs(js_urls, function() {
console.log("Bokeh: BokehJS plotting callback run at", now());
run_inline_js();
});
}
}(this));
&#13;