So my plan is to have two projects .... desktop and mobile. The desktop app is just to complex with large tables to display efficiently on mobile. So I found the following Javascript code to do a redirect. Is this a viable way to approach this?
// JavaScript Redirect based on user device
function redirectToDifferentDomain() {
// Get the user agent string
var userAgent = navigator.userAgent;
// Check if the user agent contains a string indicating a mobile device
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent)) {
// Redirect to the mobile domain
window.location.href = "https://mobile.example.com";
} else {
// Redirect to the desktop domain
window.location.href = "https://desktop.example.com";
}
}
// Call the function when the page loads
redirectToDifferentDomain();
I would prefer (mainly as a user) to get an alert if in mobile, to encourage me that "please visit our mobile friendly website by clicking here... " and by clicking the link to be redirected
*and probably a cookie remember that choice
Thanks @famousmag , that is way beyond my capabilities. And the desktop project is totally un-usable on mobile so I'd likely not want to give them a choice?
I'm not worried about that. The user login has a short session and almost always requires a log in. But maybe I should use both, the redirect and the alert. No idea how I would do the alert though.
The idea is to replace our current native app. We need mobile for this as the majority of our clients do not have access to desktop computers. We deal mainly with un-employed job seekers that don't have the luxury. Barely have mobile devices that work.
Could be easier to look at using a flow. The device running the app is available via browser.userAgent then using bootbox to present the choice of redirect or not then just browser.goto() to redirect
Maybe some sample screenshots of my desktop project will help. And this doesn't even show all data tables possible. Also the mobile app has a couple small features that are not on the desktop app such as a scannable barcode to check clients in when they come into the office. (All sample data)
So either way (1 project or 2) it would take a complete rebuild of a new project.
But with 1 project, the ongoing maintenance is quite less. I would take my medicine now, and refactor things so they work on mobile. What you are showing is absolutely doable. You already have sections that can simply stack on top of each other, then just work those inside tables.