Difficulties with the #ajax form item attribute
Since 'foo-wrapper' is replaced at the first call, it doesn't exist in the second call, and therefore, the callback doesn't know where to put the return value.

A simple solution would be to include a wrapper in the return value, with the same id as 'foo-wrapper'.

function foo_get_js($form, $form_state) {
  return '&lt;div id="foo-wrapper"&gt;' . mktime() . '&lt;xmp&gt;' . print_r($form_state['values'], true) . '&lt;/xmp&gt;&lt;/div&gt;';
}


Please note that this is untested.