title: Redirecting on confirm true
body: <p>I want to make it so the user clicks a link, they get a confirm box. If they click OK, they get sent to a new php function. </p>
  
  <p>I've tried:</p>
  
  <pre><code>function confirmReset() {
   var r = confirm('Are you sure?');
   var url = window.location.pathname;
   var pathArray = url.split('/');
   var host = pathArray[1];
   var newHost = '/headquarters/designReset';
  
   if (r == true) {
      window.location = host + newHost;
      //document.location.href = '/headquarters/designReset';
   } else {
      alert('it didnt work');
   }
   return false;
  }​
  </code></pre>
  
  <p>Firebug error says:</p>
  
  <p>SyntaxError: illegal character<br>
  }â€‹</p>
  
  <p>It's saying that â€‹ is after the } at the end of the function. I'm getting this script externally so if you post an answer make sure it works externally. Not just in the html file itself. Ive had answers that dont. Thanks!</p>