jquery load not reading string as variable (php hybrid)
<p>I'm writing out a javascript string to be parsed by jquery - it works fine as an alert but not in the jquery load function</p>

<p>PHP:</p>

<pre><code>$imgData = 'http://www.domain.com/_image.php/_MG_4156.jpg'  ;
</code></pre>

<p>which is a php script to generate a thumbnail on the fly</p>

<pre><code>&lt;script type='text/javascript' language='javascript' charset='utf-8'&gt;
&lt;!--
    var chart1img_".$i_gall." = new Image();
    var imgData   = '".$imgData."';

    $(chart1img_".$i_gall.").load(function () {
        $(this).hide();
        $('#thumb_img_div_".$i_gall."').removeClass('loading').append(this);
        $(this).fadeIn();
    }).error(function () {
        // notify the user that the image could not be loaded
        alert(imgData);
    }).attr('src', imgData); 
  //}).attr('src', 'http://www.domain.com/_image.php/_MG_4156.jpg'); 

//--&gt;
&lt;/script&gt;";
</code></pre>

<p>If I hardcore the string it works.
If I use it as the imgData variable it fails, but the alert works using imgData</p>

<p>Tried string combos all ways. Defeated. Any ideas?</p>
