I have a page created using PHP. That page contains a list of items that is returned from the database with a PHP function.

What I need is Ajax to update the list of items on the page by calling the PHP function every 5 minutes.

I already have the basic code working wich calls the content of a given page every x minutes:

var xhReq = new XMLHttpRequest ();

xhReq.open ( "GET", "file.php", false );
xhReq.send ( null );

var serverResponse = xhReq.responseText;
That code is whitin a function that is called using setinterval, which already handles the timer.

Now my question is:

Is there a way for ajax to get an array from the server or does it only receive content? I'm guessing if it only receives content, that content could be a serialized array.

So what would be the best way to do the item update?