I have some html content that I am loading in an iframe. I'm loading the html content through the srcdoc
attribute. Unfortunately, when following anchor tag links inside the iframe it loads the entire page within the iframe, instead of scrolling to the tag with the linked id.
JSFiddle that demonstrates the problem: https://jsfiddle.net/kzLdqjgs/5/
I can get the anchor tags to work using src="data:text/html,<p>my html</p>"
but I'm curious as to why it doesn't with with srcdoc. Furthermore, the src attribute for some implementations apparently has a limit of 32,768 characters and the content I'm trying to load is over 60k characters in length (though this seems to work fine in Chrome).