Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7059061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:11:13+00:00 2026-05-28T04:11:13+00:00

My function works in all browsers except ie8 and below. Can anyone tell me

  • 0

My function works in all browsers except ie8 and below. Can anyone tell me what the problem is and possibly how to fix it? Thanks!

var match;
var chords = 
['C','C#','D','D#','E','F','F#','G','G#','A','A#','B','C','Db','D','Eb','E','F','Gb','G','Ab','A','Bb','B','C'];
var chords2 = 
['C','Db','D','Eb','E','F','Gb','G','Ab','A','Bb','B','C','C#','D','D#','E','F','F#','G','G#','A','A#','C'];
var chordRegex = /C#|D#|F#|G#|A#|Db|Eb|Gb|Ab|Bb|C|D|E|F|G|A|B/g;

function transposeUp(x) {
    $('.chord'+x).each(function(){
        ///// initializes variables /////
        var currentChord = $(this).text(); // gatheres each object
        var output = "";
        var parts = currentChord.split(chordRegex);
        var index = 0;
        /////////////////////////////////
        while (match = chordRegex.exec(currentChord)){
            var chordIndex = chords.indexOf(match[0]);
            output += parts[index++] + chords[chordIndex+1];
        }
        output += parts[index];
        $(this).text(output);
    });
}

function transposeDown(x){
$('.chord'+x).each(function(){
    var currentChord = $(this).text(); // gatheres each object
    var output = "";
    var parts = currentChord.split(chordRegex);
    var index = 0;
    while (match = chordRegex.exec(currentChord)){
        var chordIndex = chords2.indexOf(match[0],1);
        output += parts[index++] + chords2[chordIndex-1];
    }
    output += parts[index];
    $(this).text(output);
});
}

EDIT

I just found out that it has to do with the split method as well. I just can’t get it fixed. The indexOf prototype works now, but tht function still isn’t working but I get an error that says chordRegex is not an object. For some reason it isn’t working.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T04:11:14+00:00Added an answer on May 28, 2026 at 4:11 am

    IE8 does not support Array.indexOf(). You will have to import one or write your own.

    See:

    • How to fix Array indexOf() in JavaScript for Internet Explorer browsers
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This works in all browsers except IE7 and IE8 ( and probably IE6 ).
I have a appendChild JS function that works beautifully in all the browsers except
This simple test code works in all browsers except IE (tested in IE8): #dBox
Short version question : Is there navigator.mozIsLocallyAvailable equivalent function that works on all browsers,
I have a JQuery slider which works fine in all browsers except IE(always a
This works in all browsers except IE. I have no idea why. Its just
I have a little problem with some jquery and http://www.mikage.to/jquery/jquery_history_noc.html The function works great,
I have a defined a click which works as desired in all except two.
This is working in all other browsers except IE. I am building a link
I have this to show a video modal which works well in all browsers

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.