How to show actual values of javascript variables in a test div?
<p>I have a 2-player boardgame with a lot of (changing) variables.
For testing purposes, I want to show all these javascripts variables inside a testdiv, like:</p>

<pre><code>&lt;div id="testdiv" style="margin-top:800px;background-color:yellow"&gt;
/** here the listing of js vars and arrays */
&lt;/div&gt; 
</code></pre>

<p>This boardgame uses a backend-file for updating the game, but i get lost when trying to follow what happens exactly with the javascript vars. 
I do know the names of the vars and arrays.
After change of turn, i refresh the page, but I want to update the page via ajax (jQuery).
For checking the playersturn, i already use jQuery and the taconite plugin form <a href="http://www.malsup.com/jquery/taconite/" rel="nofollow">http://www.malsup.com/jquery/taconite/</a>
This plugin returns xml, like this:</p>

<pre><code>### Taconite output 
?&gt;&lt;taconite&gt; 
&lt;?php 
echo $content_refresh; // refresh pagina indien nodig
echo $content_redirect;
echo $content_melding; // melding over verlaten tafel of afgewezen!
echo $content_inpartij; // tegenstander in partij??
echo $content_chataangevraagd; // chat door tegenstander aangevraagd?
echo $content_wachtopaanschuiven; // div leegmaken zodra 2e speler in partij is
echo $content_starttijd;
?&gt;
&lt;/taconite&gt;
</code></pre>

<p>Al content vars are generated xml, for example</p>

<pre><code>## Taconite: refresh nodig??

if($refresh_needed == 'ja')
{
$content_refresh = '&lt;eval&gt;&lt;![CDATA[
                                 window.location="http://www.xxxxxxxx.nl/v45/partij.php?gameID='.$_GET['gameid'].'";
                    ]]&gt; 
                    &lt;/eval&gt;';
//$meta_refresh = '&lt;replaceContent select="#refresh"&gt;&lt;META HTTP-EQUIV="refresh"     CONTENT="0"&gt;&lt;/META&gt;&lt;/replaceContent&gt;';
}
</code></pre>

<p>So, instead of refreshing I just want to update the boardgame, but just have not an overview of al (known) present javascript values. </p>

<p>Thanks in advance for any help!</p>
