Question: I'm using Drupal.

I'm trying to get a field to update every X seconds without the whole page refreshing.

I use code like this:

```
 <script>
 var refreshId = setInterval(function()
 {
      $('#responsecontainer').fadeOut("slow").load('response.php').fadeIn("slow");
 }, 10000);
 </script>

```

But `response.php` should be the field I'm refreshing?

What is this in Drupal? what do I use instead of `response.php`?

Answer: 
first of all, you should create a module for that. you should define in your module a new menu item. Eg:

```
function yourmodule_menu() {
  $items = array();
  $items["ajax/get-field-value"] = array(
    "title" => "Some title",
    "page callback" => "yourmodule_page_callback",
    "access callback" => true,
    "type" => MENU_CALLBACK
  );
  return $items;
}

```

then have your function return the actual value of that field:

```
function yourmodule_page_callback() {
  // get the field value
  print $field_value; exit;
}

```

then on your javascript code you should load the `/ajax/get-field-value` page instead of `response.php`
You might also want to look into using [node.js](http://nodejs.org/). There is a module for that (available for both Drupal 6 and 7): [nodejs module](http://drupal.org/project/nodejs).

This is now the hot new way to maintain a low-cost (in server load) connection to a client and "push" updates in data to a page, so you could have a "stock ticker" or other such information updating on the client-side.

To learn more, you can [view a good DrupalCon London session](http://london2011.drupal.org/conference/sessions/nodejs-and-drupal) on the topic of integrating Node.js with a Drupal site.