title: window.location.href vs window.open() vs AJAX - WP8 app in Intel XDK
body: <p>I am developing an HTML5 app with <strong>Intel SDK</strong>, compiling for <strong>Windows Phone 8</strong> platform, and deploying and testing on <strong>Nokia Lumia 530</strong>.</p>
  
  <p>I'm inside this scenario. I have to do from the same app 3 distinct action: (1) a call to the system browser passing a URL, (2) a call to the system telephone app passing a telephone number, (3) an ajax call to an API. </p>
  
  <p>My problem is that window.open() doesn't works for link "tel:123456789", and if try using window.location.href for telephone action I cannot use window.open() after returning to my app after the telephone call. It seems that window.location.href inhibit/block the app context for the use of window.open().</p>
  
  <p>Here's my code for clarity, I tried all combinations:</p>
  
  <p><strong>HTML</strong>:</p>
  
  <pre><code>&lt;button class="ui-btn my-button" id="button1"&gt;Bottone 1&lt;/button&gt;
  &lt;button class="ui-btn my-button" id="button2"&gt;Bottone 2&lt;/button&gt;
  &lt;button class="ui-btn my-button" id="button3"&gt;Bottone 3&lt;/button&gt;
  </code></pre>
  
  <p><strong>JS</strong> [inside var onDeviceReady=function(){ }]:</p>
  
  <pre><code>$("#button1").on("click", function () {         
      window.open ('http://www.google.it', '_blank'); // WORKS PERFECTLY BEFORE I CLICK BUTTON 2, DOESN'T WORKS AFTER
  });  
  
  $("#button2").on("click", function () {         
  
      window.open ('tel:123456789', '_blank'); // WORKS BUT BLOCKS OTHERS BUTTONS ACTIONS AFTER COME BACK IN APP FROM TELEPHONE CALL
      //window.open ('tel:123456789', '_system'); // DOESN'T WORKS, BUTTON CLICK HAS NO EFFECT
      //window.open ('tel:123456789', '_self'); // DOESN'T WORKS, BUTTON CLICK HAS NO EFFECT
  
      //window.location.href = 'tel:123456789', '_blank'; // WORKS BUT BLOCKS OTHERS BUTTONS ACTIONS AFTER COME BACK IN APP FROM TELEPHONE CALL
      //window.location.href = 'tel:123456789', '_system'; // WORKS BUT BLOCKS OTHERS BUTTONS ACTIONS AFTER COME BACK IN APP FROM TELEPHONE CALL
      //window.location.href = 'tel:123456789', '_self'; // WORKS BUT BLOCKS OTHERS BUTTONS ACTIONS AFTER COME BACK IN APP FROM TELEPHONE CALL
  }); 
  
  $("#button3").on("click", function () { 
  
      // WORKS PERFECTLY BEFORE I CLICK BUTTON 2, DOESN'T WORKS AFTER
      $.ajax({
          type: "GET",
          url: 'https://customers.clouditalia.com/public/ws_etnicom_ri?numerochiamato=05...',
          cache: false,
          dataType: "text",
          success: function (data) {                
  
              alert(data);
          },
          error: function (data) {
              alert("ERROR: response = " + data);
          }
      });
  }); 
  </code></pre>
  
  <p>Someone can give me help?</p>