title: JavaScript beginner needs help if/then/else
body: <p>I need a javascript that reads the QR code, if the URL or instruction shown matches the URL we use, it executes that script</p>
  
  <p>If not, it pops up a warning that the code link is not one of ours, and offers a button to let the user launch the QR link.</p>
  
  <p>Yes, this is a mobile app for my company to check inventory </p>
  
  <p>Here's what I have</p>
  
  <pre><code>if (data.text == 'http://gmail.com') {
      window.open(data.text, '_system', 'location=yes'); 
  }
  else
  {
      window.location = 'http://www.jths.co.uk/index.phtml?d=541300';
  }
  </code></pre>
  
  <p>the only part that works (if I remove the rest of it) is this</p>
  
  <pre><code>window.open(data.text, '_system', 'location=yes'); 
  </code></pre>