5 ms·
> My first thought was to embed anchors into the external map SVG: […] > This approach is problematic. Those anchors are only active when SVG is inline and don
by chrismorgan 1y ago
> My first thought was to embed anchors into the external map SVG: […]
> This approach is problematic. Those anchors are only active when SVG is inline and don’t work with an <img> element.
No, this approach is fine: you just need to use <object data=…> instead of <img src=…>. <object> is the correct choice for embedding interactive SVG.
But you probably do want the SVG to be inline anyway, because it will load faster and is in this case actively the content of the page; which is the technical decision he ended up at, though perhaps for partly the wrong reason.
(There’s also <iframe>.)
- King-Aaron 1y ago> There’s also <iframe> Now that's a name I've not heard in a long time...a long time.
- zyberzero 1y agoReally? I'd say image maps was the name I haven't heard in a long time... As in I read a couple of paragraphs before it dawned on me that it was _that_ type of image maps that post was about - I first thought it was something regarding rasterized maps (like OpenStreetMap or something)
- ogou 1y agoIf you're looking at any web page with ads or tracking, it has many iframe elements. The javascript that loads them usually creates an iframe and the ad appears there. A typical newspaper site could have 5-50 iframes on each page.
- patates 1y agoPerhaps you confused it with the frameset and frame? frameset: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/frameset https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/... frame: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/frame https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/... iframe: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/iframe https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/...
- deleted 1y ago[deleted]
- mock-possum 1y agoHow would you embed a pdf view in a page?
- chrismorgan 1y ago<object>. It’s a better choice than <iframe> because it ensures the PDF will be rendered, and you can control the fallback content if the user agent can’t render it.