We'll use the Browser.Platform
property to detect what platform the client uses so that we can tailor the page based on the user's operating system.
Let's figure out what the user's operating system is and put it in a variable called
userPlatform
. The values will be of a string data type and will be of the following values:win
(for Windows),mac
(for Mac OS),linux
(for Linux machines),ipod
(Apple iPhone and Apple iPod touch), andother
(platform can't be detected or is unrecognized).window.addEvent('domready', function(){ var userPlatform = Browser.Platform.name; });
Next, we build a function called
pageCustomizer
that will customize our page. We'll passuserPlatform
(later on) to it so that it knows what platform it'll be working with. Let's set that up now:window.addEvent('domready', function(){ var userPlatform = Browser.Platform.name; // Customizes download page depending on client's platform var pageCustomizer...