How to make href anchors in iframe `srcdoc` actually work
我在iframe中加载了一些html内容。 我正在通过
演示问题的JSFiddle:https://jsfiddle.net/kzLdqjgs/5/
我可以使用
my html
"使锚标记起作用,但是我很好奇为什么它与srcdoc不兼容。 此外,某些实现的src属性显然有32,768个字符的限制,而我尝试加载的内容的长度超过了60k个字符(尽管在Chrome中似乎可以正常工作)。
我发现iframe srcdoc中的
从维基百科:
about:srcdoc : A reserved, though unresolvable, URI defined within HTML5 intended to be the URI navigated to within iframes whose content comes from the srcdoc attribute.
在这里查看链接