Refresh function for a particular section

Hello All,

Is it possible to have a function which refreshers a particular section only.

I have a header which shows notifications for messages, chats and profile views. Is it possible that this section only gets refreshed, not the whole page.

i have this function but this loads the data from other page…
I want that section to be refreshed only, not to load data from other page.

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
   <script>
 function autoRefresh_div()
 {
      $("#result").load("load.html");// a function which will load data from other file after x seconds
  }

  setInterval('autoRefresh_div()', 5000); // refresh div after 5 secs
            </script>

thanks
shail

http://api.jquery.com/load/#loading-page-fragments

Hi, the load method accepts a selector after the url to just select a part of the page.

$( “#result” ).load( “load.html #result” );

It may be better to have a separate url that returns just the content you are after though, as you’re just throwing away most of the content anyway.

1 Like

thanks man… this worked