angular JS กับการลิงค์ผ่าน URLs กับ IonicFramwork

  1. ติดตั้ง Plugin
    $ cordova plugin add https://gitwipus.apache.org/repos/asf/cordovaplugininappbrowser.git
  2. จากนั้นเขียนโค๊ดดังนี้
    <ion-view title=“Test Page”>
        <ion-content>
            <div class=“list”>
                <a class=“item” href=“#” onclick=“window.open(‘http://www.rmutsv.ac.th/contact’, ‘_system’, ‘location=yes’); return false;”>
                    Open a Browser
                </a>
            </div>
        </ion-content>
    </ion-view>

    หมายเหตุ

    Code Description
    window.open(‘http://example.com’, ‘_system’); Loads in the system browser
    window.open(‘http://example.com’, ‘_blank’); Loads in the InAppBrowser
    window.open(‘http://example.com’, ‘_blank’, ‘location=no’); Loads in the InAppBrowser with no location bar
    window.open(‘http://example.com’, ‘_self’); Loads in the Cordova web view

บทความที่เกี่ยวข้องกัน

Share
User Avatar

admin

ประวัติการศึกษา ระดับปริญญาตรี : วิศวกรรมโทรคมนาคม คณะวิศวกรรมศาสตร์ พระจอมเกล้าเจ้าคุณทหารลาดกระบัง ระดับปริญญาโท : วิศวกรรมคอมพิวเตอร์ คณะวิศวกรรมศาสตร์ มหาวิทยาลัยสงขลานครินท์ หาดใหญ่

You may also like...