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`
Marius Ilie is suggesting the right direction. 

You can visit below link for more detail on how to create custom module to use javascript/jquery. See accepted answer.

[drupal module jquery php script location issue](https://stackoverflow.com/questions/8092468/drupal-module-jquery-php-script-location-issue/8092923#8092923)