soundcloud/soundcloud-custom-player — Issue #23: sc-player.js innerHTML fails with some browsers [fix]
Author: Ciantic
Created: 2011-11-04 09:08:13+00:00
State: open

Hi!

I had issue with some versions of IE if I remember correctly and code lines using innerHTML e.g.:

updates.position.innerHTML = timecode(0);
...
updates.position.innerHTML = timecode(position);
...
$('.sc-duration', $player)[0].innerHTML = timecode(tracks[0].duration);
$('.sc-position', $player)[0].innerHTML = timecode(0);

Easy fix is to use jQuery equivalents:

$(updates.position).html(timecode(0));
...
$(updates.position).html(timecode(position));
...
$('.sc-duration', $player).html(timecode(tracks[0].duration));
$('.sc-position', $player).html(timecode(0));

So pretty please, do not use innerHTML when jQuery provides a framework for doing it: $(element).html() to get and $(element).html(setvalue) to set.