I have an ajax call that sends some data to process.php and return back the image name. In process.php I returned the name as follows:
echo "image.png";
The ajax call is:
var $chart = $( '#chart' );
var $test = $( '#test' );
$.get("process.php",
{date: DateStr, birthday: birthdayStr},
function(filename) {
var fdata="./images/"+filename;
$test.text(fdata);
$('#chart').attr('src',fdata);
});
the html is:
<div id="test"></div>
<div class="mainbody">
<div id="chart" class="mainimg">
<img width="700" height="408" alt='' />
</div>
</div>
so from test div i get the path printed right: (./images/image.png), but I don't get the image to be desplayed