# Open Link in System Browser

**URL:** <https://forum.ionicframework.com/t/open-link-in-system-browser/27512>\
**Category:** ionic-v1\
**Created:** [July 1, 2015, 9:51pm UTC](https://forum.ionicframework.com/t/open-link-in-system-browser/27512 "2015-07-01T21:51:32Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Laire](https://avatars.discourse-cdn.com/v4/letter/l/ecc23a/32.png) [@Laire](https://forum.ionicframework.com/u/Laire)\
**Post date:** [July 1, 2015, 9:51pm UTC](https://forum.ionicframework.com/t/open-link-in-system-browser/27512/1 "2015-07-01T21:51:32Z")

</div>

Hello,

I want to open a link in the system browser.

I installed InAppBrowser and set as target \_system in my template:

```
<a href="http://resper.de" target="_system">
    <img class="openEx" id="openHp" src="img/icons/iconHome.png" alt="resper Homepage" />
</a>
```

---

<div class="post-metadata">

**Author:** ![nicraboy](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/nicraboy/32/6917_2.png) [@nicraboy](https://forum.ionicframework.com/u/nicraboy)\
**Post date:** [July 1, 2015, 11:09pm UTC](https://forum.ionicframework.com/t/open-link-in-system-browser/27512/2 "2015-07-01T23:09:49Z")

</div>

So what’s the problem?

---

<div class="post-metadata">

**Author:** ![beefman](https://avatars.discourse-cdn.com/v4/letter/b/439d5e/32.png) [@beefman](https://forum.ionicframework.com/u/beefman)\
**Post date:** [July 1, 2015, 11:30pm UTC](https://forum.ionicframework.com/t/open-link-in-system-browser/27512/3 "2015-07-01T23:30:24Z")

</div>

Try running `Ionic serve --lab`

Where about did you add it? It should be added inside Index.html header.

It works perfectly for me.

---

<div class="post-metadata">

**Author:** ![Laire](https://avatars.discourse-cdn.com/v4/letter/l/ecc23a/32.png) [@Laire](https://forum.ionicframework.com/u/Laire)\
**Post date:** [July 1, 2015, 11:54pm UTC](https://forum.ionicframework.com/t/open-link-in-system-browser/27512/4 "2015-07-01T23:54:19Z")

</div>

It doesnt open the link in the system browser. It open it in the app.

---

<div class="post-metadata">

**Author:** ![Laire](https://avatars.discourse-cdn.com/v4/letter/l/ecc23a/32.png) [@Laire](https://forum.ionicframework.com/u/Laire)\
**Post date:** [July 2, 2015, 12:17am UTC](https://forum.ionicframework.com/t/open-link-in-system-browser/27512/5 "2015-07-02T00:17:11Z")

</div>

I add the code. When I run the app in my browser (Riddle) it open a new tab when i click the link. When I create a APK and run it on my Android Device it open the link inside the app.

---

<div class="post-metadata">

**Author:** ![Laire](https://avatars.discourse-cdn.com/v4/letter/l/ecc23a/32.png) [@Laire](https://forum.ionicframework.com/u/Laire)\
**Post date:** [July 2, 2015, 12:59am UTC](https://forum.ionicframework.com/t/open-link-in-system-browser/27512/6 "2015-07-02T00:59:30Z")

</div>

Ok, back to start, it open in the Browser the new Tab because of the

```
 target="_system"

```

in the Tag. So it seems like the code have no effect.

index.html:

```
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
    <title></title>

    <link href="css/ionic.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">

    <!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
    <link href="css/ionic.app.css" rel="stylesheet">
    -->
    <!-- ionic/angularjs js -->
    <script src="js/ionic.bundle.min.js"></script>

    <!-- cordova script (this will be a 404 during development) -->
    <script src="cordova.js"></script>

    <!-- your app's js -->
    <script src="js/app.js"></script>
    <script src="js/controllers.js"></script>
    <script src="js/services.js"></script>
    <script>
    document.onclick = function (e) {
        e = e || window.event;
        var element = e.target || e.srcElement;

        if (element.tagName == 'A') {
            window.open(element.href, "_system");
            return false;
        }
    };
    </script>
</head>
<body ng-app="starter">
    <ion-nav-bar class="bar-stable">
        <ion-nav-back-button>
        </ion-nav-back-button>
    </ion-nav-bar>
    <ion-nav-view></ion-nav-view>
</body>
</html>

```

tab-dash.html:

```
<ion-view view-title="Notfallsanitäter Hessen">
  <ion-content class="padding">
    <div class="list card">
      <div class="item item-divider">Mehr von [res][per]</div>
      <div class="item item-body">
        <div class="contactRow">
            <a class="openEx" href="http://resper.de">
                <img src="img/icons/iconHome.png" alt="resper Homepage" />
            </a>
            <a class="openEx" href="https://www.facebook.com/ResperDe112">
                <img src="img/icons/iconFb.png" alt="Facebook" />
            </a>
            <a class="openEx" href="https://www.google.com/+ResperDe112">
                <img src="img/icons/iconGp.png" alt="Google+" />
            </a>
            <a class="openEx" href="https://www.google.com/+ResperDe112">
                <img src="img/icons/iconTwitter.png" alt="Twitter" />
            </a>
            <a class="openEx" href="https://de.pinterest.com/resper0579/">    
                <img src="img/icons/iconPinterest.png" alt="Pinterest" />
            </a>
        </div>
      </div>
    </div>
  </ion-content>
</ion-view>
```

---

<div class="post-metadata">

**Author:** ![beefman](https://avatars.discourse-cdn.com/v4/letter/b/439d5e/32.png) [@beefman](https://forum.ionicframework.com/u/beefman)\
**Post date:** [July 2, 2015, 1:22am UTC](https://forum.ionicframework.com/t/open-link-in-system-browser/27512/7 "2015-07-02T01:22:34Z")

</div>

It’s working for me.

Alternatively, you can set it up with a ng-click:

Alternatie #1:  
HTML:

```
<a ng-click="GotoLink('http://resper.de')">
   <img class="openEx" id="openHp" src="img/icons/iconHome.png" alt="resper Homepage" />
</a>

```

JS:

```
  $scope.GotoLink = function (url) {
    window.open(link,'_system');
  }

```

* * *

Alternatively #2

You can use AngularJS and ng-bing-html. A tutorial is here: [http://intown.biz/2014/03/30/cordova-ionic-links-in-browser/](http://intown.biz/2014/03/30/cordova-ionic-links-in-browser/)

---

<div class="post-metadata">

**Author:** ![Laire](https://avatars.discourse-cdn.com/v4/letter/l/ecc23a/32.png) [@Laire](https://forum.ionicframework.com/u/Laire)\
**Post date:** [July 2, 2015, 1:30am UTC](https://forum.ionicframework.com/t/open-link-in-system-browser/27512/8 "2015-07-02T01:30:49Z")

</div>

Perhaps it is a problem because I am working with Microsoft Visual Studio.

---

<div class="post-metadata">

**Author:** ![beefman](https://avatars.discourse-cdn.com/v4/letter/b/439d5e/32.png) [@beefman](https://forum.ionicframework.com/u/beefman)\
**Post date:** [July 2, 2015, 1:32am UTC](https://forum.ionicframework.com/t/open-link-in-system-browser/27512/9 "2015-07-02T01:32:19Z")

</div>

Shouldn’t be. However, i would recommend using Sublime Text 3.

---

<div class="post-metadata">

**Author:** ![Laire](https://avatars.discourse-cdn.com/v4/letter/l/ecc23a/32.png) [@Laire](https://forum.ionicframework.com/u/Laire)\
**Post date:** [July 2, 2015, 2:06pm UTC](https://forum.ionicframework.com/t/open-link-in-system-browser/27512/10 "2015-07-02T14:06:45Z")

</div>

The Error was the img tag, when i click on the image it doesn’t give back “a” it give back “img”
