I am using the $.get function in javascript to get the output of a php file.
How can this function be used to get a created image from a php file and display it in html?
In the html file (It seems an image cannot be set into a "span"):
<span id="box1"></span>
In javascript:
$.get('here.php', function(data) {
document.getElementById('box1').innerHTML=data;
});
In php:
//Set content-type header
header("Content-type: image/png");
//Include phpMyGraph5.0.php
include_once('phpMyGraph5.0.php');
The output of this is a small empty square.