using jQuery/javascript to display an image created by the server -



using jQuery/javascript to display an image created by the server -

i have script uses jquery post info through ajax php script, uses info create dynamic jpg image. php script returns binary image info output using php header image/jpeg command (so far good).

now want display image in client, haven't been able find proper solution yet. after reading bit understand possible solution have php script encode in base64 , homecoming string client info uri. however, solution won't suffice because not supported ie < 8 , still limited 32k images in ie 8.

for moment, writing image temp dir on server , homecoming filename client. however, there must way solve more elegantly through. advise on how can utilize jquery/javascript display returned binary image info in browser?

thanks!

per comment, here's had in mind. perchance solution you, depends on code.

you create img tag dynamicaly , pass url parameters php script instead of doing ajax post. code below writes out img tag since don't have php script it.

here's fiddle: http://jsfiddle.net/fehays/954zk/

img script param: <input type="text" /><br /> <button>click</button><br /> <div id="imgtext"></div> $(function() { $('button').click(function() { $('#imgtext').html('&lt;img src="imagecreator.php?param=' + $('input').val() + '" /&gt;'); }); });

javascript jquery ajax image server-side

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -