new deploy: 2022-12-30T20:12:15+00:00

This commit is contained in:
Aravinth Manivannan 2022-12-30 20:12:15 +00:00 committed by realaravinth
parent cbcf73428c
commit 55207b0068
2 changed files with 8 additions and 3 deletions

View File

@ -91,7 +91,11 @@ on enable forms.</p>
<h3 id="html-forms">HTML Forms&nbsp;<a class="anchor" href="#html-forms">&#xE732;</a></h3>
<p>Forms can be added to websites with just the HTML code for it. For
instance:</p>
<pre data-lang="html" style="background-color:#eff1f5;color:#4f5b66;" class="language-html "><code class="language-html" data-lang="html"><span>&lt;</span><span style="color:#bf616a;">form </span><span style="color:#8fa1b3;">id</span><span>=&quot;</span><span style="color:#a3be8c;">newsletter-form</span><span>&quot; </span><span style="color:#d08770;">method</span><span>=&quot;</span><span style="color:#a3be8c;">POST</span><span>&quot;&gt;
<pre data-lang="html" style="background-color:#eff1f5;color:#4f5b66;" class="language-html "><code class="language-html" data-lang="html"><span>&lt;</span><span style="color:#bf616a;">form
</span><span> </span><span style="color:#8fa1b3;">id</span><span>=&quot;</span><span style="color:#a3be8c;">newsletter-form</span><span>&quot;
</span><span> </span><span style="color:#d08770;">method</span><span>=&quot;</span><span style="color:#a3be8c;">POST</span><span>&quot;
</span><span> </span><span style="color:#d08770;">action</span><span>=&quot;</span><span style="color:#a3be8c;">https://&lt;librepages-endpoint&gt;/?path=&lt;current-path&gt;&amp;host=&lt;current-host&gt;</span><span>&quot;
</span><span>&gt;
</span><span> &lt;</span><span style="color:#bf616a;">p</span><span>&gt;
</span><span> Interested in receiving latest news about our cool product? Sign
</span><span> up for you fantastic newsletter!
@ -124,7 +128,8 @@ will be using <a href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_AP
</span><span> </span><span style="color:#b48ead;">const </span><span style="color:#bf616a;">form </span><span>= document.</span><span style="color:#bf616a;">getElementById</span><span>(&quot;</span><span style="color:#a3be8c;">newsletter-form</span><span>&quot;);
</span><span>
</span><span> </span><span style="color:#b48ead;">async function </span><span style="color:#8fa1b3;">handleSubmit</span><span>() {
</span><span> </span><span style="color:#b48ead;">const </span><span style="color:#bf616a;">url </span><span>= window.location;
</span><span> </span><span style="color:#b48ead;">const </span><span style="color:#bf616a;">url </span><span>=
</span><span> &quot;</span><span style="color:#a3be8c;">https://&lt;librepages-endpoint&gt;/api/v1/forms/submit?host=&lt;current-host&gt;&amp;path=&lt;current-path&gt;</span><span>&quot;;
</span><span> </span><span style="color:#b48ead;">const </span><span style="color:#bf616a;">data </span><span>= {
</span><span> email: document.</span><span style="color:#bf616a;">getElementById</span><span>(&quot;</span><span style="color:#a3be8c;">email</span><span>&quot;),
</span><span> };

File diff suppressed because one or more lines are too long