Page 1 of 1

external link and back navigation

Posted: Thu Oct 03, 2013 5:32 pm
by Sean Kelley

Hi
I have a button that opens external site from my web app.
I use on button click:
window.location='http://www.mysite.com';

The link works but clicking 'back' to get back to app from external site breaks something. If you come back, the page with the link button has no back button and if you click back again to go to another in-app page, service cannot be called for second page.

For example
If you click on blue list item, then click 'sellers web site' button, then click back from external site to app, then back again to get to list, then go to non-blue list item, service does not run to load page contents.

http://appery.io/app/view/3208501b-d6...

I understand it has something to do with jquery mobile history. I do not know to make it so clicking the browser's back until I get to list, will allow the second page (non-blue) list item target to load correctly. Is there is another way to link externally to avoid this problem.


external link and back navigation

Posted: Thu Oct 03, 2013 6:35 pm
by Maryna Brodina

Hello! As you navigate to app to saddlePage page from external site app reloads and saddlePage becomes main page. You bind to all saddlePage pages id in address line so navigation from page viewSaddleAds to saddlePage (with another id in address line) leads to creating 2 equal pages. You would need to review app logic or as an option try to use childBrowser to open external site.


external link and back navigation

Posted: Thu Oct 03, 2013 8:01 pm
by Sean Kelley

Hello,
So you are recommending a phongegap solution but this is a web app. is there any way to do it without using phonegap?
I have tried:
window.open(site, 'system'); //which I think is childbrowser (phonegap I think)
and
window.open(site, 'blank'); //which is newer inapp browser (phonegap I think)

Both create new window with no ability to go back on iOS6 or windows test machine. Android/samsung phone does do slick back looking action. These solutions are workable but not ideal given I have been avoiding using phonegap to be as desktop compatible as possible (if that makes any sense).

Is the behavior you are describing jquery mobile controlled? If so, seems like there should be some way to leave the site and come back.


external link and back navigation

Posted: Fri Oct 04, 2013 1:06 pm
by Kateryna Grynko

Hi Sean,

In your case, the application must be able to start at any specific page.

The problem is described above.

The page (where you navigate to a site) should maintain its state before transferring the user to another site. That is, you need to capture the moment of transition, save all important application data, remember even the time of transition to an external link, if it's important, and only then "let the user go". You can save the data in a localStorage variable or in cookies or in database. Using localStorage can speed up the process.

Similarly, the previous page should be ready to take advantage of the previously stored data in such an unexpected return.

This is a difficult task which requires extremely careful testing. Often choose a simple solution - do not start page when opened directly (when returning back or the direct link) checking the absence of some vital data can simply redirect the user to the start page of the application.


external link and back navigation

Posted: Sat Oct 05, 2013 6:48 pm
by Sean Kelley

thanks for the tips