How To Use PHP Variable Into jQuery .load() Script?
<p>I have this jQuery script with <code>.load()</code> function and this script saved on file named <code>header.php</code>:</p>

<pre><code>$(document).ready(function() {
    $('.my-wrapper').find(".wrapper-area").append('&lt;div class="loadergif"&gt;&lt;/div&gt;').load("file001.php?key=XXXXXX", function() {
    $(this).find('.wrapper-area').remove('.loadergif');
    var $container = $('.list-wrap');

    $container.imagesLoaded( function(){
        $container.masonry({
        itemSelector : '.my-wrapper'
        });
    });
});
</code></pre>

<p>on the other side, I have this PHP variables on file named body.php :</p>

<pre><code>while($row = mysql_fetch_array($result)){
    $Key = $row['key'];
    echo '&lt;div class="wrapper-area"&gt;';
       //jQuery script will produce something here             
    echo '&lt;/div&gt;&lt;!-- .wrapper-area --&gt;';
}
</code></pre>

<p>now the problem is how to bring that $Key from PHP file becomes XXXXXX part of jQuery script : '<code>file001.php?key=XXXXXX</code>'</p>

<p>please note that $Key is dynamically generated from WHILE loop. means, it has different value each loop cycle.</p>

<p>thanks before</p>
