0

I think I did a good chunk of researches around the web but nothing seems to fit with what I'm looking for. For various reasons, I can't use anything but pure JS. Here's the thing :

I have 2 HTML files : fileA and fileB. fileA's purpose would be to pass a value to fileB, then download fileB with that value. Like, something like that in fileA's content (the following tag is absolute nonsense, I just want to illustrate what I'm hoping to do somehow) :

<a href="exports/fileB.html?value" download="newFile.html">Download</a>

After looking around, I guess this is impossible to achieve for a mountain of reasons, but still. If you know an obscure magical JS library capables to make this a reality, or any trick / work around, I'd be gladful. Thanks for reading anyway !

Kaybward
  • 11
  • 3
  • https://stackoverflow.com/questions/2897619/using-html5-javascript-to-generate-and-save-a-file – Alex Jun 12 '21 at 16:05
  • Does this answer your question? [Using HTML5/JavaScript to generate and save a file](https://stackoverflow.com/questions/2897619/using-html5-javascript-to-generate-and-save-a-file) – BadPiggie Jun 12 '21 at 16:23
  • Make you HTMLs in servers a templates. Render your html after applying passed variable to those templates. – Karthikeyan Jun 12 '21 at 16:27
  • If I didn't miss anything, this would be perfect if I was only using fileA, but I'm not sure how to reach fileB's outterHTML for encodeURIComponent (which would be in fileA). – Kaybward Jun 12 '21 at 16:35

0 Answers0