jQuery .animate() not executing
<p>I am using .animate to try and create a tile based game. I am mixing jQuery with another ajax script to try and make this work. I keep clicking an arrow to move but get no result. Maybe someone else would understand why?</p>

<p>Buttons:</p>

<pre><code>$data .= "&lt;center&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;button onclick=\"transition(\'up\')\"&gt;&amp;uarr;&lt;/button&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;button onclick=\"transition(\'left\')\"&gt;&amp;larr;&lt;/button&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;button onclick=\"transition(\'right\')\"&gt;&amp;rarr;&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;button  onclick=\"transition(\'down\')\"&gt;&amp;darr;&lt;/button&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/center&gt;";
</code></pre>

<p>Map:</p>

<pre><code>$data .= "&lt;div style=\'width:480px;height:480px;background-color:#000000;background-image:url(".$map['background'].");padding:".$map['locationpadding'].";\' id=\'locationMap\'&gt;";


$data .= "&lt;div id=\'specialLocations\'&gt;&lt;/div&gt;";


$data .= "&lt;div style=\'position:absolute;left:".$charrel[0]."px;bottom:".$charrel[1]."px;width:32px;height:32px;background-image:url(".$char['charimage'].");\' id=\'charLocation\'&gt;&lt;/div&gt;";


$data .= "&lt;/div&gt;";
</code></pre>

<p>Finally, getting the animation. I have made sure the if statements are all working. So everything is working fine up to this point.</p>

<pre><code>if($_POST['direction'] == "up"){

        print("$('#charLocation').animate({'bottom': '+=50px'}, 'slow');");

    }elseif($_POST['direction'] == "left"){

        print("$('#charLocation').animate({'left': '-=50px'}, 'slow');");

    }elseif($_POST['direction'] == "right"){

    print("$('#charLocation').animate({'left': '+=50px'}, 'slow');");

    }elseif($_POST['direction'] == "down"){

    print("$('#charLocation').animate({'bottom': '-=50px'}, 'slow');");

    }else{
        die('alert("Invalid movement.");');
    }
</code></pre>

<p>And the reasoning for printing the jQuery/JavaScript code through PHP is that everything is loaded via Ajax code so I am never printing.</p>

<p>Sorry for any confusion ahead of time and thanks for looking over this for me.</p>
