Comments (3)
This is a javascript problem, and causes this error:
google.charts.load() cannot be called more than once with version 45 or earlier.
which happens because of turbolinks https://github.com/turbolinks/turbolinks .
Turbolinks is a method to make pages load faster by making ajax requests and replacing the body of the page. This way the browser doesn't have to reload the
and the tag.Because of Turbolinks we are effectively always on the same page (home) and the others are loaded via js. This means that we start in home, the google charts js gets executed the first time, and remains in ram, so that when we visit the page again, the body is re-executed, but it finds the google charts library already loaded and complains.
The solutions are:
- moving that code (or at least the google.charts.load() part) in a tag in the header (which isn't re-executed because it is only loaded once). Note that the chart, instead, should be redrawn on every visit. This means we should have some part of the code either in a 'script' tag in the body or wrapped in a turbolinks:load event listener. This may be tricky.
- disabling turbolinks altogether (which we can very well do, especially because we are not so concerned with performances right now)
from isamuni.
I get that!
On one hand: yes, lets disable turbolinks! But I do not want to make the webapp too slow. One think is having the app tested locally, but once deployed I would not be surprised to see event 30-50+ people there at the same time (expecially on day-0). Not big numbers, but who knows...
Can't we have the js code in the layout.js
file?
Note that the chart, instead, should be redrawn on every visit.
The onLoad() function will not work I guess, but rails might have something for us. I will look for that.
from isamuni.
Solved with commit:
fd97e72
from isamuni.
Related Issues (20)
- /feed - source selector is css-less
- Editing pages should be trivial HOT 15
- pages - website link not saved HOT 1
- card footers are broken HOT 1
- Handling of dead pages and accounts HOT 1
- Modify button/link for pages
- List of page owners
- Admins should be able to hide events HOT 1
- Feed is not showing all posts for the month? HOT 1
- external link button not working correctly HOT 3
- site-assistant logo not displayed HOT 2
- Set an opendata license for the data exported by isamuni api HOT 1
- Use select2 for handling tags in user edit form
- Allow users with role=editors access to sections of rails_admin
- Refactor json endpoints by using jbuilder HOT 1
- Fix twitter images for pages on mobile
- Fix look and responsive behaviour of Datatables
- Take event informations from Eventbrite
- Consider using Filterrific to display server-side-filterable tables
- Facebook is now providing a user summary for a user within a group
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from isamuni.