P
P
pcmyonelove2022-03-12 19:24:55
HTML
pcmyonelove, 2022-03-12 19:24:55

How to pass through the data html scheme by reference so that the page opens?

How to pass the html code generated by the server through data html and open the page when clicking on the link?

<a href="data:text/html;charset=utf-8,<h2>hello</h2>">click</a>
<!--и так-->
<a onlick="document.location.href='data:text/html;charset=utf-8,<h2>hello</h2>';" href="">click</a>


This is how (following the example from mdn) does not work(
Any ideas?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Sergey, 2022-03-12
@hahenty

https://developer.mozilla.org/ru/docs/Web/HTTP/Bas...

Security
Issues Several security issues (eg, phishing) are related to Data URLs and navigating them from the document root. To address these issues, navigating URIs beginning with the data:// scheme from the document root is no longer possible in Firefox as of version 59 (and as of version 58 in Nightly/Beta versions of the browser). Hopefully other browsers will follow suit as well. See Blocking Top-Level Navigations to data URLs for Fi... for more information .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question