title: Cordova/Ionic window.location not working on wp8/jquery not working with ionic
body: <h2>EDIT:</h2>
  
  <p>Big edit!!! The problem wasn't window.location after all, but that the my_button_click function was initialized before the device was ready. Huge mistake on my side.
  Additionally I had to change the div, that responds to ng-click with a button to make it work.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$ionicPlatform.ready(function() {
    $scope.my_button_click = function() {
      //...
      }
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;button class="my_button" ng-click="my_button_click()"&gt;&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <h2>Original question:</h2>
  
  <p>I'm developing a cordova app for all platforms, which is already working fine on android and iOS.</p>
  
  <p>Building and running the app on a windows phone device (EDIT: Microsoft Lumia 640, Windows Phone 8.1. Update 2), I ran into a problem. To navigate from the home screen to another screen, I have used a button with a ng-click event:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$scope.my_button_click = function () {
          window.location.href = "#/app/another_screen";
        };</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="my_button" ng-click="my_button_click()"&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>This is working on android and iOS. On windows phone 8.1 however, when I first load the app, the ng-click is not working. But after a few random other clicks through the app, the button works and redirects to the other screen.
  The button in the second screen on the other hand (that redirects back to the homescreen using window.location) isn't working at all. </p>
  
  <p>On SO I have found several questions concerning this issue, which suggest solving this problem using jquery mobile:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>//window.location.href = "#/app/another_screen";
  //replace with
  $.mobile.navigate("#/app/another_screen");</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="lib/jquery/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="lib/jquery.mobile-1.4.5/jquery.mobile-1.4.5.min.js"&gt;&lt;/script&gt;
  &lt;script src="lib/ionic/js/ionic.bundle.js"&gt;&lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>But ionic and jquery mobile don't seem to be working together, since they both have their own ways of navigating through the app.</p>
  
  <hr>
  
  <p>Has anybody encountered similar issues?</p>
  
  <p>Is jquery really the answer to my problem or did I take a wrong turn there?</p>
  
  <p>Is there another workaround to window.location, that is working on the windows platform?</p>
  
  <p>Thanks in advance!</p>