This is a way of accessing information about the end user. You can do anything with the information this neat little function returns.Examples of info that it provides are:
- OS - Returns the operating system - Language - Returns the language in plain text - Day - Returns the day as a word - Hours - Returns the amount of hours (24h clock) - TimeOffset - Returns the Offset as configured on the user's computer - Date - Returns the Day number (e.g. 1-31) - DateSuffix - Note: This should be used after Date and will return th, st, rd or nd as appropriate - Mins - This is the number of minutes - Month - This is the month *name* - MonthNum - This is the month *number* (1-12) - Year - This is the 4-digit year number - ResolutionX - This is the width of the screen in pixels - ResolutionY - This is the height of the screen in pixels - DotsPerInch - This is the DPI of the user's screen - PixelAspect - This is the Pixel Aspect Ratio of the user's screen
You can simply include the file (either via AS or copy and pasting the code) and use this function: getStats(“OS”)
Ideal for cross-compatibility, browser research (send the data back to the server?), integration and simply some welcome text.
To minimize file size, the file is not set up to work with all languages by default, you will need to add them. This is generally not necessary. The next bit will explain how you add them.There is literally an if statement that you can use as a template, you just need to add them on if you need them. Donâ€™t add them if you donâ€™t need to because they add to the file size (which is minimal at the moment).
Language Tag Supported Countries and Tags English en United States = US, United Kingdom = UK French fr Korean ko Japanese ja Swedish sv German de Spanish es Italian it Simplified Chinese zh PRC (Simplified Chinese) = CN Traditional Chinese zh Taiwan (Traditional Chinese) = TW Portuguese pt Polish pl Hungarian hu Czech cs Turkish tr Finnish fi Danish da Norwegian no Dutch nl Russian ru Other/Unknown xu