Q:

rebuild website for web 2.0

I want to rebuild my own old ASP classic website to new standarts of web2.0 in PHP (as I understand it). On my main website page there are some areas that must show last updated things like: last threads on forum, last news, last talkbacks and etc. For now (on ASP version) I have all data loaded from DB to Application (memory) and page is reloaded every 4 minuts and each time taking data from Application. If data was changed (new talkback was added for example) Application object is set to null and data reloaded from DB.
My question is about best practices in web2.0: how should I make these areas been refreshed? I need to find the way to refresh only some parts of page. I thought about 2 ways:
1. put (again) data in memory, put iframes on page and reload them.
2. create data in XML file on server and load it from there each 4 minutes, when new thing added (like new talkback) recreate the XML file.
Is there some best practicies for solving such things?

A:

You can replace the content of some divs with a html code got from an ajax request. For example:
<script type="text/javascript">
  setInserval(function() {
    $.ajax({
      url: "response.php", // Page url
      data: "querystring=1&ciao=2", // Your querystring
      type: "POST", // Request type
      dataType: "html", // Expected result
      success: function(data) { // On success
        $("#id_div").html(data); // Replace the content of #id_div with the response
      }
  }, 240000);
</script> 

The page response.php must return the html to replace and require jQuery.

