php - How can i load a picture with jquery? -
I am currently working on a square which creates a picture with the PHP in the form of a picture. I want to load these pictures with jquery dynamically. How can i do it I do not have a real picture file, just the contents of the file when I call it with AJAX ... and I can not just define php scripts as src because I have to pass the post parameters in the picture .. Edit.
OK: I think I have to tell it a bit more ...
Here is the html code:
& lt; Div & gt; & Lt; Img id = "image" / & gt; & Lt; / Div & gt; & Lt; Input type = "button" onclick = "loadPicture ();" / & Gt; When the button is pressed, some data should be sent to the PPT script which generates the image, a callback function or something similar, now the picture should be posted in the IMG element. Just posting pictures in the img tag does not work. The following code will work, but how can I add post parameters?
& lt; Img src = "& lt; scriptname & gt; .php" />
The HTP post requests are not meant to return resources. Why do not you use the GET request? The way to 'relax' is to create a picture with a post request and then have to load it with a GET request. You need to define the URL mapping for your resources.
Comments
Post a Comment