- This topic has 7 replies, 2 voices, and was last updated 7 years, 8 months ago by
Mads Barnkob.
-
AuthorPosts
-
May 19, 2017 at 9:28 am #4436
Radu
KeymasterApparently if works in Safari right away, while Chrome says “Failed to load resource: net::ERR_INSECURE_RESPONSE” and the code only shows the purple “Loading”.
“Your resource probably use a self-signed SSL certificate over HTTPS protocol. Chromium, so Google Chrome block by default this kind of resource considered unsecure. ”
You can bypass this this way :
Assuming your frame’s URL is https://www.domain.com, open a new tab in chrome and go to https://www.domain.com.
Chrome will ask you to accept the SSL certificate. Accept it.
Then, if you reload your page with your frame, you could see that now it works
The problem as you can guess, is that each visitor of your website has to do this task to access your frame.You can notice that chrome will block your URL for each navigation session, while chrome can memorise for ever that you trust this domain.
This problem will be fixed in a more elegant way, as soon as the entire site moves to HTTPS, soon.
LE: if you can use the code , changing the HTTPS to HTTP in the api calls in the javascript code (not on JSFiddle), then it will work as well.
May 19, 2017 at 11:08 am #4455Mads Barnkob
ModeratorI was using Chrome.
I can confirm that Fiddle works straight out of the box in MSIE, but not when the code is ran from my own website: http://kaizerpowerelectronics.dk/everyday-science/radiation-monitoring/ no matter if its http/https in the code, and my domain seems to redirect all to http, if I try https.
May 19, 2017 at 11:40 am #4456Radu
KeymasterThe code runs with errors:
[Error] TypeError: $ is not a function. (In ‘$(“#status”)’, ‘$’ is undefined)
downloadUnits (radiation-monitoring:325)
Global Code (radiation-monitoring:424)You will need to add JQuery too, it is also in JSFiddle, top-left of the screen. But easier, here is what you need to add to the blog’s headers:
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/dygraph/1.1.1/dygraph-combined.js"></script>
May 19, 2017 at 1:18 pm #4457Mads Barnkob
ModeratorThis was only my 2nd time using Fiddle, so I completely missed there was a external references tab 🙂
I can get it to fetch the data, but not draw it, on my own site ( http://kaizerpowerelectronics.dk/everyday-science/radiation-monitoring/ )
The same terrible hacked up code works in Fiddle ( https://jsfiddle.net/pzr8efr8/ )
I will take a look at it later when you say the backend is ready 🙂
August 9, 2017 at 1:29 pm #4745Mads Barnkob
ModeratorDirectly copied from fiddle and runs outside of wordpress, its the same problem :/
August 10, 2017 at 3:58 pm #4756Radu
KeymasterHi Mads,
You can use the “Inspect element” / “Inspect” to get info on what happens on various web pages. This shows there’s an error in the code, see the pic attached.
Apparently, you called the Javascript that does download and chart BEFORE the html code initialised the code for the chart DIV. Please do the javascript after.
Let me know if this helps,
Attachments:
August 27, 2017 at 7:33 am #4817Mads Barnkob
ModeratorYou are absolutely right!
I just stopped thinking and put all the javascript in the top 😮
-
AuthorPosts
- You must be logged in to reply to this topic.