title: Inject GET parameter to target URL of a button, on click
body: <p>I have multiple buttons with the class <code>myButton</code>. Each button has a value which is send to a server on click. The target URL of the button does look like this:</p>
  <pre><code>http://mysite/test/test.html?cid=15
  </code></pre>
  <p>After I click on the button, the following GET parameter should be added to the URL and then the button should be submitted:</p>
  <pre><code>mySessionVar=1
  </code></pre>
  <p>So the new URL should look like this:</p>
  <pre><code>http://mysite/test/test.html?cHash=d009eb3f9f4e1020435b96a8f7251ad5&amp;mySessionVar=1
  </code></pre>
  <p><strong>Why I have to inject it?</strong></p>
  <p>I am working with <code>fluid</code>. AFAIK it is not possible to manipulate fluid tags with JavaScript. However, I need to add a <code>sessionStorage</code> item value to the fluid tags <code>arguments</code> attribute.</p>
  <p>My fluid code:</p>
  <pre><code>&lt;f:link.action controller=&quot;Download&quot; action=&quot;download&quot; arguments=&quot;{cid: category.uid}&quot; class=&quot;myButton&quot;&gt;Download&lt;/f:link.action&gt;
  </code></pre>
  <p>So my attempt is to append my sessionStorage item as GET parameter to the target URL of the button and then send it, e.g.:</p>
  <pre><code>$(&quot;.myButton&quot;).on
  (
    &quot;click&quot;,
    function(event)
    {
        //First prevent the default event
        event.preventDefault();
  
      ...inject the sessionStorage item as GET parameter to the target URL of the button, then do whatever the button would do normally...
  
        //Go to new URL
        window.location.replace(NEW URL);
    }
  );
  </code></pre>
  <p>Is this possible?</p>
  <p>EDIT: This is how the rendered HTML of the buttons looks like:</p>
  <pre><code>&lt;a class=&quot;myButton&quot; href=&quot;/de/mysite/test/test.html?tx_mydownloads_myfilelist%5Bcid%5D=15&amp;amp;&amp;amp;tx_mydownloads_myfilelist%5Baction%5D=download&amp;amp;tx_mydownloads_myfilelist%5Bcontroller%5D=Download&amp;amp;cHash=d009eb3f9f4e1020435b96a8f7150ad5&quot;&gt;Download&lt;/a&gt;
  </code></pre>
  <p>EDIT: I have another idea, maybe I could just read the target URL somehow, then add my new GET param to it and then load that URL with <code>window.location.replace</code>?</p>