Created
July 29, 2012 22:20
-
-
Save anonymous/3202151 to your computer and use it in GitHub Desktop.
Soundcloud iFrame Memory Leak
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title>Leak Tester</title> | |
</head> | |
<body> | |
<div id="container"></div> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
var addFrame = function() { | |
console.log("Adding frame!"); | |
$('.mixframe').remove(); | |
var url = 'http://w.soundcloud.com/player/url=http://api.soundcloud.com/tracks/54453743&show_artwork=true&show_comments=false'; | |
var iframe = $('<iframe>').attr('width', '100%') | |
.attr('height', 166) | |
.attr('scrolling', 'no') | |
.attr('frameborder', 'no') | |
.attr('src',url) | |
.addClass('mixframe'); | |
$('#container').append(iframe); | |
}; | |
setInterval(addFrame, 5000); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment