JavaScript browser information for Sitemagic CMS

Unfortunately not all browsers support the same features, and some contain bugs that we may need to work around. Browser detection can be used to write code against specific browsers or browser versions. This is fairly simply using the SMBrowser class which provides various information about the browser being used.
// Get name of browser. One of the following values are
// returned: Chrome, Safari, MSIE, Firefox, Opera, Unknown
var browserName = SMBrowser.GetBrowser();

// Get the browser (major) version number
var version = SMBrowser.GetVersion();

// Get the browser language. Returns e.g. "da" for Danish, "en" for English etc.
var language = SMBrowser.GetLanguage();

// Get browser page dimensions (width/height);
var width = SMBrowser.GetPageWidth();
var height = SMBrowser.GetPageHeight();