Page 1 of 1

Redirecting PC viewers of a mobile web app to a page explaining the mobile web app

Posted: Tue Nov 19, 2013 1:16 am
by Joe6207668

Hello!

I need help implementing a method that would redirect a viewer of my mobile web app. Ideally, the app is to act as a mobile web app, however it doesn't look right on a PC sized display.

My problem is where to add the js code using the Appery builder. Do I need to check in the http header for device screen display size?

Also I'm not sure whether to add a page using the builder and redirect PC viewers to it, or redirect to a different website entirely.

Thanks!
Joe


Redirecting PC viewers of a mobile web app to a page explaining the mobile web app

Posted: Tue Nov 19, 2013 4:51 am
by maxkatz

It's up to you where or how you want to redirect the user. You should be able to find scripts on the Internet that check the user's browser and allow you to redirect to some URL.


Redirecting PC viewers of a mobile web app to a page explaining the mobile web app

Posted: Tue Nov 19, 2013 4:52 am
by maxkatz

Redirecting PC viewers of a mobile web app to a page explaining the mobile web app

Posted: Tue Nov 19, 2013 4:27 pm
by Joe6207668

Hey Max!

Thanks for the quick response and the useful article.

So I'm guessing this is the js code I need to redirect my PC viewers:
window.location.replace("http://mydomain.com");

Where exactly should I add this code? As a javascript file in my project? Also any useful tips regarding checking my user's screen size would be helpful.

Thanks!
Joe


Redirecting PC viewers of a mobile web app to a page explaining the mobile web app

Posted: Tue Nov 19, 2013 5:22 pm
by maxkatz

You could do it on page load.