0

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

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by rse
0

if I'm not mistaken, divs can't have src attribute.. so try placing the id 'chart' in the img tag..

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.