Software Archive
Read-only legacy content
17061 Discussions

open a download link from website in IOS & Android default web browser

janed_o_
Beginner
686 Views

I have website which offers some mp3 downloads. if i try to click those link through IntelXDK InApp browser ...it does nothing.

if i open through inside intelxdk for example this link then it opens in defualt web browser.

http://domain.com/sample.mp3

I can't update each time my app...I want to open a download link from website in IOS & Android default web browser.

Please help

 

 

0 Kudos
6 Replies
Hamilton_Tenório_da_
Valued Contributor I
686 Views

Are you using cordova-plugin-inappbrowser?

With this plugin, I use>  cordova.InAppBrowser.open(URL, '_blank', 'location=yes');

URL can be http://xxxxxxx, mailto:yyy@kkkkk, etc.

0 Kudos
janed_o_
Beginner
686 Views

@Hamilton Tenório da Silva yes i m using  cordova-plugin-inappbrowser.

can u give me a example for this link http://domain.com/sample.mp3

 

how do i put this on my website?

0 Kudos
Hamilton_Tenório_da_
Valued Contributor I
686 Views

Sure. In my app I have a function like this:

function funAbreURL(cURL) {
    cordova.InAppBrowser.open(cURL, '_blank', 'location=yes');
}

This function is called when occurs a click:

$(document).on("click", "#spaLinkHTS", function () {
    funAbreURL("http://www.hts-net.com.br");
});

 

0 Kudos
janed_o_
Beginner
686 Views

i am very beginner to all this.

I know only html and i have website. it got many download links.

i dont know anything...please it will be helpful if you put complete demo project. (Complete Code)

please help

Thank u very much

 

 

0 Kudos
xkevin
New Contributor I
686 Views

Hamilton Tenório da Silva wrote:

Sure. In my app I have a function like this:

function funAbreURL(cURL) {
    cordova.InAppBrowser.open(cURL, '_blank', 'location=yes');
}

This function is called when occurs a click:

$(document).on("click", "#spaLinkHTS", function () {
    funAbreURL("http://www.hts-net.com.br");
});

 

I am finding a solution on how to open a link in a browser. Tried you sample code but dont work on mine. Can you help me figure out whats wrong on my code?

<script>
            $(document).on("click", "#join_browser", function () {
                join_browser("https://www.example.com/page/join");
            });
            
            $(document).on("click", "#password_browser", function () {
                password_browser("https://www.example.com/retrieve");
            });
            
            function join_browser(joinURL) {
                cordova.InAppBrowser.open(joinURL, '_blank', 'location=yes');
            }
            
            function password_browser(passURL) {
                cordova.InAppBrowser.open(passURL, '_blank', 'location=yes');
            }
            
 </script>


 <label class="text-style text-center">Don't have an account? <a href="#" id="join_browser"> Register here. </a>
</label>

 <label class="text-style text-center">Forgot password? <a href="#"  id="password_browser"> Click here. </a>
 </label>

 

0 Kudos
xkevin
New Contributor I
686 Views

Oops.. don't worry. I got this workin now. I have to use a button not an "<a>" tag link to work. Thanks for idea anyway!

0 Kudos
Reply