Closed muriloime closed 4 years ago
Hi, @muriloime . Thank you for your contributions.
This is a good idea, but your implementation seems like the old way to do it.
Can't we just use a defer
attribute on the script tag?
98% of browsers already support it anyway.
Or, do you have any concern with it?
Hi @styd, after you said I tried to implement the defer tag, but it seems that it only works for external scripts (https://www.w3schools.com/tags/att_script_defer.asp ). So this approach (which is similar to chartkick) is the way to go IMO.
cheers
Oh, you're right. How did I miss that. defer
attribute is to defer loading a script, so of course it's for external files. Thank you.
Hello, I added a very simple functionality to include an option defer to deferred charts.
It is defaulting to false for backward compatibility.
Cheers Murilo