Javascript function in chrome makes black lines appear
I'm using a javascript function to play a mp3 file when I click a button.
var soundEmbed = null;
function soundPlay(url) {
if (soundEmbed)
document.body.removeChild(soundEmbed);
soundEmbed = document.createElement("embed");
soundEmbed.setAttribute("src", "/snd/"+url+".mp3");
soundEmbed.setAttribute("hidden", true);
soundEmbed.setAttribute("autostart", true);
document.body.appendChild(soundEmbed);
}
In google chrome when I click the button, the sound plays but the scrollbar on the right turns into a black line and there is a thin strip of black on the top of the window to the left. On firefox 开发者_如何学运维and IE, it is fine, no black lines.
Anyone know what the problem is/how to fix it?
Also when i put a soundEmbed.setAttribute("loop", true);
in there, it doesnt loop on chrome either, while it does with IE/firefox.
Make sure you are using the latest possible version of Google Chrome.
精彩评论