Closed yellow1912 closed 3 years ago
I wonder if it's possible to do something like this:
<script src="https://unpkg.com/@popperjs/core@2" async></script> <script src="https://unpkg.com/tippy.js@6" async></script>
The problem is that there is no guaranty that popperjs will be loaded first, so I was thinking if it's possible to do something like this:
<script src="https://unpkg.com/@popperjs/core@2" async onload="triggerEventTellingPopperIsLoaded"></script> <script src="https://unpkg.com/tippy.js@6" async onload="triggerEventTellingTippyIsLoaded"></script>
Only once both are loaded then tippy is initialized. Is it possible like that? I'm thinking it's possible to do something like this:
Instead of loading https://unpkg.com/tippy.js@6 directly, I could build my own file with something like this
tippy.js
if (popperIsLoaded) { import tippy from 'tippy.js'; }
I feel like something is wrong with this though?
Use defer not async
defer
async
I wonder if it's possible to do something like this:
The problem is that there is no guaranty that popperjs will be loaded first, so I was thinking if it's possible to do something like this:
Only once both are loaded then tippy is initialized. Is it possible like that? I'm thinking it's possible to do something like this:
Instead of loading https://unpkg.com/tippy.js@6 directly, I could build my own file with something like this
tippy.js
I feel like something is wrong with this though?