Open a link on page load inside the app itself using Ionic

I am trying to open a web page on index page load in ionic. This is what i have written

<!DOCTYPE html>
<html>
<head>

<script>

window.location = "http://www.google.com/";


   </script>
</head>
<body class="platform-android platform-cordova platform-webview">

</body>
</html>

Put this doesn't works. I have already downloaded the inapp browser plugin as described here but this doesn't works.

cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser.git

Can someone help asap.Thanks in advance.

To open the webpage using InAppBrowser plugin use:

cordova.InAppBrowser.open("http://www.google.com/", '_system');

This will open the webpage in a new window. Make sure you call it after the library has loaded and the application is ready, preferably in $ionicPlatform.ready callback called from your app's run() function or controller.