title: reload the page after clicking 'OK" using Sweetalert
body: <p>Trying to reload the page after a success message, but it is not reloading.. </p>
  
  <p>I have this code</p>
  
  <pre class="lang-js prettyprint-override"><code>$.ajax({
    type: "post",
    url: '/action.cfm?method=quote',
    data: datastring,
    success: function(data) {
      var valid = $.trim(data);
      if (valid.toLowerCase().indexOf("error") == '-1') {
        localStorage.setItem("swal", swal({
          title: "Good job!",
          text: 'Thanks',
          type: "success",
          showConfirmButton: true
        }).then(function() {
          location.reload();
        }));
        localStorage.getItem("swal");
      } else {
        swal("Oops", data, "error");
      }
    }
  });
  </code></pre>
  
  
  
  <p>but I get an error on this </p>
  
  <pre><code>(index):389 Uncaught TypeError: Cannot read property 'then' of undefined
      at Object.success ((index):389)
      at fire (jquery-1.12.4.js:3232)
      at Object.fireWith [as resolveWith] (jquery-1.12.4.js:3362)
      at done (jquery-1.12.4.js:9840)
      at XMLHttpRequest.callback (jquery-1.12.4.js:10311)
  </code></pre>