Support Forums for LiveMesh Themes & Plugins › Forums › Appdev Theme Support › Can Get App button handle multiple systems? › Reply To: Can Get App button handle multiple systems?
October 17, 2013 at 10:30 am
#2267
livemesh
Keymaster
If I understand your question right, you want to change the download link based on the OS from which the user is visiting the page. May guess is that you don’t need to disable the Get App button; you will need to change the URL of the Get-App button in the Javascript based on the OS detected –
p = navigator.platform; download_link = "http://www.app-download.com/"; if( p === 'iPad' || p === 'iPhone' || p === 'iPod' ){ download_link = "http://www.app-download.com/app"; } else if (p.toUpperCase().indexOf('MAC')!==-1) { download_link = ""http://www.app-download.com/mac-app"; } else if (p.toUpperCase().indexOf('WIN')!==-1) { download_link = ""http://www.app-download.com/windows-app"; } else if (p.toUpperCase().indexOf('LINUX')!==-1) { download_link = ""http://www.app-download.com/linux-app"; }; $("#get-app-button").attr("href", download_link);
Here is some more information on how to detect the OS –
http://stackoverflow.com/questions/9038625/detect-if-device-is-ios