title: Redirect to page and pass text and image parameter - HTML JS
body: <p>I have a product page with 20 or so products on it. When you click on a product link I would like to pass 2 parameters to the page it redirects to, an image src and a text attribute and then display these in divs.</p>
  
  <p>ATM my code sets a title and img data attribute , redirects to the correct page with the attributes in the URL string but I'm not sure how to display this information properly. </p>
  
  <p>How can I pass both a title and img attribute parameter to the lineup/index.html page and then display these 2 attributes? Also is there a better way of doing this than putting the attributes in the URL query string?</p>
  
  <p>Product link</p>
  
  <pre><code>&lt;a href="#" class="product" data-img="product1-img.jpg" data-title="Product1"&gt;More Information&lt;/a&gt;
  </code></pre>
  
  <p>products.js</p>
  
  <pre><code>jQuery(document).ready(function($){
      $('.product').click(function(event) {
          var name;
          name = $(this).data('title');
          window.location = './lineup/index.html?title=' + name + 'img' + img;
      });
  });
  </code></pre>
  
  <p>lineup/index.html</p>
  
  <pre><code>&lt;div class="text_area"&gt;
      &lt;div id="title-area"&gt;TITLE ATTRIBUTE&lt;/div&gt;
      &lt;div class="product-img"&gt;
        IMG SRC
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>If anyone needs more code just shout, I am using just plain HTML, javascript and jQuery.</p>