Hi
I am trying to get an image to refresh on its own (and not touch the rest of the page) on a button being pressed, the catch is that the image also needs to pass the contents of a form to a MagickWand back- end script for processing but for the life of me, I cannot get it to work unless I refresh the whole page using PHP. The image is actually a PHP page passing some arguments...
I have two approaches in mind:
1) Ajax, However I cannot figure out how to do this using Ajax and cannot find anything that useful to go off....
2) Javascript.
Using this code
I can get the image to reload on button press, but I cannot work out how to pass the contents of the active form to it (I know how I might do it, get javascript to read the values of the form, then drop those values into the image URL), but I can't work out how to drop the values into the URL
I am trying to get an image to refresh on its own (and not touch the rest of the page) on a button being pressed, the catch is that the image also needs to pass the contents of a form to a MagickWand back- end script for processing but for the life of me, I cannot get it to work unless I refresh the whole page using PHP. The image is actually a PHP page passing some arguments...
I have two approaches in mind:
1) Ajax, However I cannot figure out how to do this using Ajax and cannot find anything that useful to go off....
2) Javascript.
Using this code
PHP:
function refreshimage(){
document.getElementById('test').src = document.getElementById('test').src + '#';
}
I can get the image to reload on button press, but I cannot work out how to pass the contents of the active form to it (I know how I might do it, get javascript to read the values of the form, then drop those values into the image URL), but I can't work out how to drop the values into the URL