refactor 3-more into separate books
This commit is contained in:
parent
bd1d5e4305
commit
87639b2740
423 changed files with 9 additions and 9 deletions
32
6-optimize/2-memory-leaks-jquery/jquery-leak.view/index.html
Normal file
32
6-optimize/2-memory-leaks-jquery/jquery-leak.view/index.html
Normal file
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<script src="http://code.jquery.com/jquery.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="data"></div>
|
||||
|
||||
<script>
|
||||
|
||||
function go() {
|
||||
|
||||
$('<div/>')
|
||||
.html(new Array(1000).join('text'))
|
||||
.click(function() { })
|
||||
.appendTo('#data');
|
||||
|
||||
document.getElementById('data').innerHTML = '';
|
||||
|
||||
}
|
||||
|
||||
var interval = setInterval(go, 10)
|
||||
</script>
|
||||
|
||||
Утечка идёт...
|
||||
|
||||
<input type="button" onclick="clearInterval(interval)" value="stop"/>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue