This was the way Irish words were written before the arrival of the typewriter to Ireland, and as the typewriter did not have a facility to place a dot above consonants, a 'h' suffix was used instead and has remained to this day. My PHP function above converts modern Irish words back to the traditional sort.

Anyway, I now want to do this with Javascript. As the average page contains about 15,000 characters, I was wondering what would be the most efficient way of doing this.

I tested the following jQuery functions, which seem to work, but I´m not sure how to add the entire array, and I´m not sure if it´s the most efficient way for 15,000 characters of text..