lazy loading - How to run a javascript function when a page dynamically loads content -


i writing javascript code adds tags across text in html file after page loads. use

window.onload 

method achieving this.

however, facing issue in pages google plus, more content scroll down. there way of calling js function when such page adds more content?

thanks

akshay

there several ways how working. can either use jquery this:

$('#mydiv').bind("domsubtreemodified",function(){     // code goes here     alert('changed'); }); 

note not supported in ie8( , below).

or can run loop , continuously fire desired code:

var interval = setinterval(function() {     // code goes here }, 1000); 

fiddle: http://jsfiddle.net/8rf5r/5/


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -