-
-
Notifications
You must be signed in to change notification settings - Fork 389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Realtime graph javascript error in Chrome #3580
Comments
There is actually an issue open for this but the race condition makes sense. We really need to ensure the realtime.js is loaded before we initialise then. |
Sorry, I don't know how I missed the open issue, I did a cursory search before I raised this but couldn't see anything open for realtime... The "fix" I put in seems to be working OK, but it may need to be tested against multiple browsers before passing muster. |
To be fair, the previous one was closed prematurely, and I'd not reopened it yet despite seeing the evidence presented as I hadn't had a chance to diagnose it myself. |
Yes I had #3538. Just tested this code change for the onload and I'm working again as well. Tested on a few browsers and PCs we initially had issues with, all good now. |
Thanks for the help and support on this one. |
jQuery + Chrome race condition
When starting a realtime graph in Chrome, the following javascript error occurs, and the graph isn't rendered:
I had a look at the code and it appears that the jQuery document ready $(function() {}) in graph_realtime.php is executing before the realtime.js file is loaded, so the imageOptionsChanged() function isn't defined at this point.
I tried this in Firefox and it seemed to work OK there, so likely something specific to browsers based on the Chromium V8 engine.
The simple fix is to change the graph_realtime.php ready function to use the
$(window).on('load',function{})
binding like so:I've tested in Chrome and Firefox and it seems to work fine with the change.
To Reproduce
Steps to reproduce the behavior:
Desktop (please complete the following information)
The text was updated successfully, but these errors were encountered: