How to stop js from running ? : I have seen a video tutorial on Youtbe about [Dynamic Content][1] that when user reaches the bottom of a page ,it automatically loads new div. (Something like facebook homepage). But it just keeps loading & never stop that! I don't know how to stop that. Here's the full code:

        <!DOCTYPE html>
    <html>
    <head>
    <script>
    function yHandler(){
    	// Watch video for line by line explanation of the code
    	// http://www.youtube.com/watch?v=eziREnZPml4
    	var wrap = document.getElementById('wrap');
    	var contentHeight = wrap.offsetHeight;
    	var yOffset = window.pageYOffset; 
    	var y = yOffset + window.innerHeight;
    	if(y >= contentHeight){
    		// Ajax call to get more dynamic data goes here
    		wrap.innerHTML += '<div class="newData"></div>';
    	}
    	var status = document.getElementById('status');
    	status.innerHTML = contentHeight+" | "+y;
    }
    window.onscroll = yHandler;
    
    </script>
    <style>
    div#status{position:fixed; font-size:24px;}
    div#wrap{width:800px; margin:0px auto;}
    div.newData{height:1000px; background:#09F; margin:10px 0px;}
    </style>
    </head>
    <body>
    <div id="status">0 | 0</div>
    <div id="wrap"><img src="temp9.jpg"></div>
    </body>
    </html>

**To test it on your desktop ,plz make sure you have the image with the name of *temp9.jpg***


  [1]: https://www.youtube.com/watch?v=eziREnZPml4&index=37&list=PLGlcsQuIFMgJBt-4GDm8ZZpR_nnKPW9g4