The funniest thing about this is to watch the seconds tick as it updates... :)
Your code is useless... you need to actually perform an ajax request:
http://api.jquery.com/jQuery.ajax/
This works for me:
<?php
class qa_html_theme extends qa_html_theme_base
{
function doctype() {
if(qa_post_text('ajax_reload_q_list')) return;
qa_html_theme_base::doctype();
}
function html()
{
if(qa_post_text('ajax_reload_q_list')) {
$this->q_list($this->content['q_list']);
return;
}
qa_html_theme_base::html();
}
function head_custom() {
if(isset($this->content['q_list'])) {
$this->output_raw("<script>
jQuery('document').ready(
function() {
startAjaxQListRefresh();
}
);
function startAjaxQListRefresh() {
window.setTimeout(
function() {
getAjaxQList();
},
5500
);
}
function getAjaxQList() {
var dataString = 'ajax_reload_q_list=true';
var out = '';
jQuery.ajax({
type: 'POST',
url: '".qa_self_html()."',
data: dataString,
success: function(data) {
jQuery('.qa-q-list').replaceWith(data);
startAjaxQListRefresh();
}
});
}
</script>");
}
}
}