title: CodeIgniter : How to retrieve ajax jquery data passed through window.location.href in new controller
body: <p>CodeIgniter : How to retrieve ajax jquery data passed through <code>window.location.href</code> in new controller ?</p>
  
  <pre><code>$(".x").on("click","a.p",function(){       
              productId =  $(this).attr("productId");        
              alert("product ID : " + productId); 
              $.ajax({
                 url: 'home/allProductDetails',
                 type: 'POST',
                 data: {
                   'productId'  : productId
                 },
                 success: function (dat) {
  
                      var result = eval('(' + dat + ')');
                      if (result.success == true)
                      {   
                          if(result.data.length&gt;0)
                          {//alert("Success");window.location.href = "newControllerName" + "?result=" + result.data;
                           }
                      }
  </code></pre>
  
  <p>on ajax success, the data is passed to the new controller using window.location.href</p>