There is some .php file, that returns .png image file.
How to get this image with jQuery $.ajax() ?
Also, is there were some mistakes with input parameters, .php file will return error in JSON way.
How to understand, which infomation was returned – image or JSON with error?
UPDATE:
I need to draw some statistics graphics with this script. .php file gets some data (for example account id, which statistics is requested) and checks – if this user (user id is got from session is allowed to view the requested user’s statistics, or not). If it’s allowed than image is returned, if not – than json error.
So i can make but if there will be error, image doesn’t load. But I need to show error notification to user.
You can use it like this:
So i suggest you get the base64 encoded string from the ajax request and use that to display the image