title: How can I load html code based on url parameters?
body: <p><strong>Hi,</strong></p>
  <p>I am trying to load HTML code and display it on my site based on the URL parameters.
  I want it to work like this. My shortcut (Siri Shortcuts) will redirect people to <code>https://example.com/index.html?page=[HTML CODE HERE]</code>. Then the HTML code that is in that URL variable, will display on the site (not the blank text but overwrite the existing code so it will display that HTML page). The problem is I am doing it with this code below.</p>
  <pre><code>window.onload = function() {
    try {
      var url_string = (window.location.href).toLowerCase();
      var url = new URL(url_string);
      var page = url.searchParams.get(&quot;page&quot;);
      document.write(page);
    }
  }
  </code></pre>
  <p>It works fine when I want it to output 'test' (<code>https://example.com/index.html?page=test</code>). But when I put the whole HTML code in the url variable, it won't output anything.</p>
  <p><strong>NOTE:</strong> I am still new to HTML and JS.</p>