title: window.location.href is not Refreshing/Reloading the page
body: <p>creating a refreshcart() function and in the function window.location.href is assigned to currentUrl. But while making an ajax call in the else block window.location.href = currentUrl, true; It doesn't refresh the page.</p>
  
  <pre class="lang-js prettyprint-override"><code>$(document).ready(function() {
    var productForm = $(".form-product-ajax")
  
    productForm.submit(function(event) {
      event.preventDefault();
      //console.log("Form is not sending!")
      var thisForm = $(this)
      //var actionEndpoint = thisForm.attr("action");
      var actionEndpoint = thisForm.attr("data-endpoint");
      var httpMethod = thisForm.attr("method");
      var formData = thisForm.serialize();
  
      $.ajax({
        url: actionEndpoint,
        method: httpMethod,
        data: formData,
        success: function(data) {
          console.log("success: ", data)
          //currentPath = window.location.href --if cart is in current path--
          if (window.location.href.indexOf("cart") != -1) {
            refreshCart()
          }
        },
        error: function(errorData) {
          console.log("error: ", errorData)
        }
      })
    })
  
    function refreshCart() {
      console.log("In current cart")
  
      var currentUrl = window.location.href
  
  
      var refreshCartUrl = '/api/cart/'
      var refreshCartmethod = "GET";
      var data = {};
  
      $.ajax({
        url: refreshCartUrl,
        method: refreshCartmethod,
        data: data,
        success: function(data) {
          console.log("success: ", data)
          console.log("If block starts")
          if ([data.products].length &gt; 0) {
            console.log("Condition checked")
          } else {
            console.log("It came here")
            window.location.href = currentUrl, true;
          }
        },
        error: function(errorData) {
          console.log("Oh no! error: ", errorData)
        }
      })
    }
  })
  </code></pre>