title: how to pass variable value in window.location.href in javascript?
body: <p>In this code work well and show all data.this is the piece of javascript code</p>
  
  <p>checkoutCart:</p>
  
  <pre><code>function(products, totalPrice, totalQuantity) {
          var checkoutString = "Total Price: " + totalPrice + "\nTotal Quantity: " + totalQuantity;
          checkoutString += "\n\n id \t name \t summary \t price \t quantity \t image path";
          $.each(products, function(){
            checkoutString += ("\n " + this.id + " \t " + this.name + " \t " + this.summary + " \t " + this.price + " \t " + this.quantity + " \t " + this.image);
          });
      alert(checkoutString)
  </code></pre>
  
  <p>after this code, I am wanted to use href attribute  with id passing.after the working of alert function then press ok button after that my href link work well but show in url bar order.php?id=undefined . here is code</p>
  
  <pre><code>window.location.href="order.php?id="+this.id ;
  </code></pre>