PhoneGap Redirection From html server file to local file

I’m developing an iPhone PhoneGap application and stumbled upon a problem redirecting the user after logging in.

The stream is as follows:

  • Download application.
  • I redirect the user to the login page located on the remote server and pass the parameter of the current page so that the user is redirected after a successful login.

    eg. http://www.myloginserver.co.il?ret= 'is the URL of the local html file.

The problem is that I cannot get the login page to redirect to local html.

I tried passing the following URLs:

  • window.location.href
  • window.location.href.substring (window.location.href.indexOf ("www /")
  • "file: ////" + window.location.href.substring (window.location.href.indexOf ("www /")

Has anyone encountered this issue?

Thanks Udi

+4
source share
1 answer

Interest Ask. I am not sure if this is possible ... what I would like to do is create a registration form locally in your / www / and use AJAX to query the server and check if I was able to log in. Then, in the callback function of your AJAX request, you can determine whether you can send them to the next page or try logging in again.

0
source

Source: https://habr.com/ru/post/1481975/


All Articles