Skip to content
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

Suggestion: Suggest loading the script with the nomodule attribute #198

Open
coliff opened this issue Nov 20, 2020 · 2 comments
Open

Suggestion: Suggest loading the script with the nomodule attribute #198

coliff opened this issue Nov 20, 2020 · 2 comments

Comments

@coliff
Copy link

coliff commented Nov 20, 2020

All the browsers which support the nomodule support fully support SVGs so loading svg4everybody as follows:

<script nomodule src="/path/to/svg4everybody.js"></script>

will save HTTP requests/bandwidth for all modern browsers (approx 93% marketshare).
All old browsers will load svg4everybody as normal.

Let me know if you'd like me to open a PR to update the README.

@inquiztr
Copy link

how do you manually invoke svg4everybody() call for only those browsers?

@coliff
Copy link
Author

coliff commented Feb 16, 2023

<script nomodule>svg4everybody()</script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants