How to handle page redirection in Phonegap?


hello,

 

basically app working on webapp when ported phonegap encountered issues.

 

my app page redirection behavior redirects url defined on server via nodejs express router

 

e.g href="/searching" --> point backend routing

 

 

router.get('/searching', ensureauthenticated, function (req, res) {

  if(sess.usertype == 1) {

    res.render('searching'); //which renders searching.html

  } else {

    res.redirect('/login');

  }

});

 

 

however, when trying access page in phonegap, i'm getting

 

file:///android_asset/www/views/searching net::err_file_not_found

 

 

but when tried replacing href="searching.html", works lose back-end logic since it's not passing there. i'm puzzled how handle routing logic phonegap? what's logic of it... how should think in building end-to-end hybrid app. btw, i'm using framework7.

 

any hint or advice help. lot.

when have link href="/searching", directing url relative current page. current page running locally on in phonegap on android device ... you're sending request file:///android_asset/www/views/searching. need redirect full server url i.e. href="http://myserver.com/searching".

 

all said, shouldn't rendering views on server, result in slower responsiveness, , bad offline experience.



More discussions in PhoneGap Build


adobe

Comments

Popular posts from this blog

Illustrator CS6 Ocurrío un error E/S en el archivo.

Animate - problem with duplicating scripts after loop

Why is os_ViewContainer running?