diff options
| author | hallgren <hallgren@chalmers.se> | 2012-04-01 18:23:28 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2012-04-01 18:23:28 +0000 |
| commit | 1db4fab25cf6c884c842d7c127e69c00179f145a (patch) | |
| tree | dfe5a6763979136f85e031916d8a8a11d1baaad9 | |
| parent | 07b2e41c2cc1bc635d92a6a37356f7e1199d192d (diff) | |
support.js: add an implementation of Array.isArray for older browsers that lack it
| -rw-r--r-- | src/www/minibar/support.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/www/minibar/support.js b/src/www/minibar/support.js index 557a3b41f..f06b8db2a 100644 --- a/src/www/minibar/support.js +++ b/src/www/minibar/support.js @@ -12,6 +12,14 @@ function bind(f, this_value) { return function () {return f.apply (this_value, arguments)}; }; +// Implement Array.isArray for older browsers that lack it. +// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/isArray +if(!Array.isArray) { + Array.isArray = function (arg) { + return Object.prototype.toString.call(arg) == '[object Array]'; + }; +} + /* --- JSONP ---------------------------------------------------------------- */ // Inspired by the function jsonp from |
