Calling javascript function on page load in ionic app


#1

I have created an application based on the a ready ionic templates. It works fine but then i changed the index.html where i placed following code to show a url on page load but then it’s not working.

<html>
<head>
<script>
        window.location = "https://whr-glbl-whitepages.appspot.com/mobile/";
    </script>
</head>
<body class="platform-android platform-cordova platform-webview">
</body>
</html>.

Can some please help as i have tried multiple things and got totally stuck on this.
Thanks in advance !!


#2

Have you received any error?

Have you tried using:

window.open(destination,'_self');