![]() |
How to print a image from a php function with AJAX? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: How to print a image from a php function with AJAX? (/showthread.php?tid=49573) |
How to print a image from a php function with AJAX? - El Forum - 02-25-2012 [eluser]DocFunky![/eluser] Hi There, I'm looking create an upload function in AJAX, but my image doesn't print even if I can see it in firebug lite with chrome, here is my code : So first is the view : Code: [removed] Then here is the ajaxImage Controller : all I do is a resize, that seems to work : Code: public function ajaxImage(){ Do you think any error in this MVC coded upload function? It is coded with codeigniter, but I don't think the problem come from a badly used CI function, it is more like I don't know how to bring back my image, I'm a newbie with javascript and ajax Thanks for your help ![]() How to print a image from a php function with AJAX? - El Forum - 02-25-2012 [eluser]CroNiX[/eluser] Problem is in your javascript. You need to have a 'success' method that actually does something with the data you are returning. All you are doing is submitting the data. Anything returned is ignored. How to print a image from a php function with AJAX? - El Forum - 02-25-2012 [eluser]InsiteFX[/eluser] Code: <div id="loading" class="center"> See the display:none in the css file loading id? remove the display:none then when finish put it back. How to print a image from a php function with AJAX? - El Forum - 02-25-2012 [eluser]DocFunky![/eluser] All right ! I made it !! In fact, the problem was from my path : I used $path=$data['upload_data']['full_path']; When I should have used $path='images/uploads/'.$data['upload_data']['file_name']; Because it returned me something like D:/ that the browser doesnt understand. But yet, I still have a problem with my crop function : I put my question here : http://ellislab.com/forums/viewthread/211875/ Thanks to you anyway ![]() |