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
PHP:
$imgData = 'http://www.domain.com/_image.php/_MG_4156.jpg' ;
which is a php script to generate a thumbnail on the fly
<script type='text/javascript' language='javascript' charset='utf-8'>
<!--
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');
//-->
</script>";
If I hardcore the string it works. If I use it as the imgData variable it fails, but the alert works using imgData
Tried string combos all ways. Defeated. Any ideas?