php - Auto refresh multiple divs with Jquery -


im creating dashboard large display @ work, have managed 1 div auto refreshing php request page, can't think of way of using function on div script without copying entire function , renaming it, seems dumb.

this have far:

<script type="text/javascript">  $(document).ready( function update()  {     $.get("response.php", function(data){             $("#ajaxtest").html(data);             window.settimeout(update, 10000);         }); }); </script> 

i did searching on stackoverflow , found nifty little extract, although single div use only... (second example: auto refreshing div jquery)

$(document).ready(  function update(el)  {     $.get("response.php", function(data){     el.html(data);     window.settimeout(el, 10000); });  update($("#ajaxtest"));  }); 

Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -