title: jQuery onClick pass a variable via GET to URL and load that URL
body: <p>I know how to pass variables through AJAX calls via onClick to a PHP file and asynchronously loading the results on the initial page. </p>
  
  <p>I now need to analogously pass a variable via onClick to a PHP file but I need to open a new window or redirect the whole page with the passed variable. The URL needs to contain the variable, so that the query/results can be "statically" sent to someone, like 'xyz.php?var=xyz'</p>
  
  <p>I thought I could do something like this</p>
  
  <pre><code> $("#submit").click(function(event) {                
          var category_id = {};
          category_id['linkgen'] = $("#linkgen").val();
          $.ajax({    
            type: "GET",
            url: "generatedlink.php",        
            dataType: "html",   
            data: category_id,         
            success: function(response){ 
               window.open('generatedlink.php');  
            }
          }); 
        });
  </code></pre>
  
  <p>This only opens 'generatedlink.php'. I actually want what is passed via AJAX, i.e. 'generatedlink.php?linkgen=blabla' onClick in a new window/reloaded page! I'd very much appreciate your help.</p>