I have an HTML page with many <object>
tags, each including a different SVG image.
Example:
<object type="image/svg+xml" data="first.svg"></object>
<object type="image/svg+xml" data="totally-different.svg"></object>
In Google Chrome, the page initially displays as expected. However, if I browse away from the page, then return using the back/forward buttons, the SVG images are shuffled: they can appear inside the wrong <object>
tag.
Example:
On first view, the page appears as per the markup:
<object type="image/svg+xml" data="first.svg">
<!-- first.svg will appear here -->
</object>
<object type="image/svg+xml" data="totally-different.svg">
<!-- totally-different.svg will appear here -->
</object>
After back/forward, the images may be swapped
<object type="image/svg+xml" data="first.svg">
<!-- totally-different.svg will appear here! -->
</object>
<object type="image/svg+xml" data="totally-different.svg">
<!-- first.svg will appear here! -->
</object>
How do I prevent this erroneous behaviour?