4 ms·
> an SVG file can contain multiple images for different sizes by the use of media queries They can also contain JavaScript and you can use that to vary by GET
by donatj 6y ago
> an SVG file can contain multiple images for different sizes by the use of media queries
They can also contain JavaScript and you can use that to vary by GET parameters. A trick we use quite heavily.
- chrismorgan 6y agoEh, not really. If you load the SVG directly (open a .svg file, or write inline SVG in your HTML), then yes, you can run JavaScript, but when it’s loaded as an image (<img src=example.svg>, or <link rel=icon href=example.svg>), JavaScript will not be executed.