Istvan
Posts: 0
Joined: Mon Oct 13, 2014 1:48 pm

URL opening with link component

Hi,

I have a RSS page in my app. I would like to open the source page inappbrowser or on new page with a back to app function.

Actually im use a link component and when tap the link then go to the web page without navigation or back button. I cannot navigate from this page at all.

How can i get a back button or other solution to back navigate?

Thanks

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

URL opening with link component

Hi -

Please check InAppBrowser documentation page to learn more about the component, and any other settings and options.

Istvan
Posts: 0
Joined: Mon Oct 13, 2014 1:48 pm

URL opening with link component

Hi Illya

It was the first :-) but I cannot use togheter with link component :-(

M&M
Posts: 0
Joined: Tue Nov 11, 2014 6:59 am

URL opening with link component

hi Istvan,

You can store the value / link that the user has clicked and then navigate to another page. In that page, in either the load event (preferably show event), read from that local storage variable ( or global javascript variable)and navigate to that page...something like this

Page show event
window.open('http://www.google.com");

Cheers,
M&M

M&M
Posts: 0
Joined: Tue Nov 11, 2014 6:59 am

URL opening with link component

I mean

Page show event
var navToURL = localStorage.getItem('saved_url');
window.open(navToURL);

And on this page you can have a header or a footer with a button. The button can have a simple JS script like history.back(); That should take you back to the page from where you landed on this page.

P.N: Remember to choose the correct target as described in http://wiki.apache.org/cordova/InAppB...

Cheers,
M&M

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

URL opening with link component

Hi Istvan,

You can follow these steps:

  1. add "click" event handler.

  2. Set action - "Run javascript".

  3. Populate this action with following JS code:

    pre

    var link = jQuery(this);

    window.open(link.attr("href"), "_blank");

    arguments[0].stopPropagation();
    arguments[0].preventDefault();

    /pre

    Details: http://prntscr.com/5q86bi/direct

    Regards.

Istvan
Posts: 0
Joined: Mon Oct 13, 2014 1:48 pm

URL opening with link component

Thanks Yurii!

Unfortunatly I see now only... the source webpage is terrible on mobile :-( not responsive and very unique and an other person did it. I cannot change.

Can I somehow get the page source into appery local variable (base on link)? Then I can cut out the useful content parts and show in app ...

Thanks
István

Ihor Didevych
Posts: 0
Joined: Wed Nov 19, 2014 7:55 pm

URL opening with link component

Hi Istvan,

You can make service that makes a simple GET to the page, the response area of that service will be needed page

Istvan
Posts: 0
Joined: Mon Oct 13, 2014 1:48 pm

URL opening with link component

Hi Ihor

... response is invalid ... :-(.

Do you have a working solution?

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

URL opening with link component

Hi lstvan,

  1. Use "appery.io" proxy(to get work in browser).

  2. Ignore "invalid response" and use "complete" service datasource event handler. Here is a code example:

    pre

    var resultResponse = jqXHR.responseText;

    //You can find this response in console. (on device use WEINRE debugger).
    console.log("resultResponse = " + resultResponse);

    /pre

    Regards.

Return to “Issues”