Open eckhchri opened 9 years ago
root cause looks like problem within webworlker enviroment.
Workaround:
convert object to an array: http://api.jquery.com/jQuery.makeArray/ JQuery: isArraylike(obj) Test if its an array: http://jsfiddle.net/kflorence/JUxZA/
Check type of vars via
http://stackoverflow.com/questions/1303646/check-whether-variable-is-number-or-string-in-javascript
function isNumber(o) { return typeof o == "number" || (typeof o == "object" && o.constructor === Number); }
Possible Solution: Object.keys(myObject).length // seems to be working in Firefox and Chrome but not MS Edge
Examples, with different result in FireFox and Chrome for "aTrackList = new Array()": Object.keys(aTrackList).length aTrackList.length
1.) Change for to foreach (http://stackoverflow.com/questions/10563251/length-of-a-javascript-associative-array )
2.) http://api.jquery.com/jquery.each/ 3.) in cases of using "if (aTrackList.length != 0)": https://msdn.microsoft.com/library/d8ez24f2%28v=vs.94%29.aspx array.length() did not provide the number of entries
http://www.shermann.name/2010/11/firefox-and-chrome-different-javascript.html
root cause looks like problem within webworlker enviroment.
Workaround:
convert object to an array: http://api.jquery.com/jQuery.makeArray/ JQuery: isArraylike(obj) Test if its an array: http://jsfiddle.net/kflorence/JUxZA/
Check type of vars via
http://stackoverflow.com/questions/1303646/check-whether-variable-is-number-or-string-in-javascript
function isNumber(o) { return typeof o == "number" || (typeof o == "object" && o.constructor === Number); }
Possible Solution: Object.keys(myObject).length // seems to be working in Firefox and Chrome but not MS Edge
Examples, with different result in FireFox and Chrome for "aTrackList = new Array()": Object.keys(aTrackList).length aTrackList.length
1.) Change for to foreach (http://stackoverflow.com/questions/10563251/length-of-a-javascript-associative-array )
2.) http://api.jquery.com/jquery.each/ 3.) in cases of using "if (aTrackList.length != 0)": https://msdn.microsoft.com/library/d8ez24f2%28v=vs.94%29.aspx array.length() did not provide the number of entries
http://www.shermann.name/2010/11/firefox-and-chrome-different-javascript.html