I have project for my study I read x,y from touch pad and draw it as real time drawing with php, I create draw page that take x,y and draw it on an image, another page display this image (inside div)
it must be displayed many time in second I try to use ajax but it dose not work on the image unless I refresh the page manually
then I use this
but this way is not acceptable by my supervisor!!!
please I need any helpful idea to refresh the div that contain the image from the code
I have project for my study I read x,y from touch pad and draw
Share
You need to refresh the div while it contains the same image? Is that because the image itself changes (is rendered each time on request)?
If so, you’re browser cache is probably your problem. You can set the img src url to the base img url and add a parameter, like
yourimage.jpg?x, where x is a value you change each time. That way, you’ll byass the browser cache.You don’t need Ajax to load images. You can just set the img src or a div background-image to do that. The browser will automatically load it.
I doubt however if you can do this so many times a second.