IE8 is giving me the following error:
Object doesn’t support this property or method on custom.js, line 82 character 7
Here is the code with line numbers:
78 function transpose(chord, increment){
79 var scale = ["C", "C#", "D", "Es", "E", "F", "F#", "G", "As", "A", "B", "H"];
80 return chord.replace(/[CDEFGABH]#?s?/g,
81 function(match){
82 var i = (scale.indexOf(match) + increment) % scale.length;
83 return scale[ i < 0 ? i + scale.length : i ];
84 });
85 }
What should I change so that the code works in IE8? It works properly in Firefox/Chrome and also in IE9.
You can try a indexOf polyfill, this is needed due to
indexOfbeing part of ECMAScript 5th Edition and thus not implemented by all browsers (actually just IE8 and lower).