在Https中不工作的第三方图表api

时间:2022-11-29 02:16:51

i am Using a third party Chart API Simile for showing the Charts.this works fine til i use HTTP, but since i moved over to HTTPS: this chart API failed to load,

我正在使用第三方图表API明喻来显示图表。这在我使用HTTP之前运行良好,但是由于我转移到HTTPS:这个图表API未能加载,

No chart rendered for HTTPS communication but same works for HTTP ???

没有为HTTPS通信提供的图表,但同样适用于HTTP ?

2 个解决方案

#1


1  

Are you using the 'hosted' timeline api? I mean referencing: http://api.simile-widgets.org/timeline/2.3.1/timeline-api.js. This might be the reason why it's not working:

您是否使用“托管”时间轴api?我的意思是引用:http://api.simile-widgets.org/timeline/2.3.1/timeline-api.js。这可能是它不起作用的原因:

  1. If your application is running under HTTPS you'll need to include a HTTPS version of that script (or remove the "HTTP:", use //api.simile-widgets.org/timeline/2.3.1/timeline-api.js instead).
  2. 如果应用程序在HTTPS下运行,则需要包含该脚本的HTTPS版本(或者删除“HTTP:”,使用// //api.simile-widgets.org/timeline/2.3.1/timeline-api.js)。
  3. Maybe you didn't notice, but there is no HTTPS version of the hosted API (you'll get a Not Found error when accessing it through HTTPS).
  4. 也许您没有注意到,但是托管API没有HTTPS版本(通过HTTPS访问时将会出现未找到的错误)。

In order to solve the issue I suggest you upload the JS file to blob storage and reference it like this from your application:

为了解决这个问题,我建议您将JS文件上传到blob存储中,并从您的应用程序中这样引用它:

//youraccount.blob.core.windows.net/mycontainer/timeline-api.js (without http: or https:)

// /youraccount. blob.core.net/mycontainer/timeline -api.js(没有http:或https:)

#2


0  

If you load the chart API from an external non-HTTPS URL most browsers will (per default) prevent loading the external (I assume) JavaScript content. You either have to host the API yourself or load it from an external host with a valid SSL certificate.

如果从外部非https URL加载图表API,大多数浏览器(默认情况下)将阻止加载外部(我假设)JavaScript内容。您要么自己托管API,要么使用有效的SSL证书从外部主机加载它。

Questions like How to Include CSS and JS files via HTTPS when needed? show ideas on how to handle this situation when supporting HTTP and HTTPS.

诸如如何在需要时通过HTTPS包含CSS和JS文件的问题?在支持HTTP和HTTPS时,展示如何处理这种情况的想法。

#1


1  

Are you using the 'hosted' timeline api? I mean referencing: http://api.simile-widgets.org/timeline/2.3.1/timeline-api.js. This might be the reason why it's not working:

您是否使用“托管”时间轴api?我的意思是引用:http://api.simile-widgets.org/timeline/2.3.1/timeline-api.js。这可能是它不起作用的原因:

  1. If your application is running under HTTPS you'll need to include a HTTPS version of that script (or remove the "HTTP:", use //api.simile-widgets.org/timeline/2.3.1/timeline-api.js instead).
  2. 如果应用程序在HTTPS下运行,则需要包含该脚本的HTTPS版本(或者删除“HTTP:”,使用// //api.simile-widgets.org/timeline/2.3.1/timeline-api.js)。
  3. Maybe you didn't notice, but there is no HTTPS version of the hosted API (you'll get a Not Found error when accessing it through HTTPS).
  4. 也许您没有注意到,但是托管API没有HTTPS版本(通过HTTPS访问时将会出现未找到的错误)。

In order to solve the issue I suggest you upload the JS file to blob storage and reference it like this from your application:

为了解决这个问题,我建议您将JS文件上传到blob存储中,并从您的应用程序中这样引用它:

//youraccount.blob.core.windows.net/mycontainer/timeline-api.js (without http: or https:)

// /youraccount. blob.core.net/mycontainer/timeline -api.js(没有http:或https:)

#2


0  

If you load the chart API from an external non-HTTPS URL most browsers will (per default) prevent loading the external (I assume) JavaScript content. You either have to host the API yourself or load it from an external host with a valid SSL certificate.

如果从外部非https URL加载图表API,大多数浏览器(默认情况下)将阻止加载外部(我假设)JavaScript内容。您要么自己托管API,要么使用有效的SSL证书从外部主机加载它。

Questions like How to Include CSS and JS files via HTTPS when needed? show ideas on how to handle this situation when supporting HTTP and HTTPS.

诸如如何在需要时通过HTTPS包含CSS和JS文件的问题?在支持HTTP和HTTPS时,展示如何处理这种情况的想法。