I have a JavaScript function which passes variable to servlet, servlet does some calculations and produces a result in image format
var x,y,z;
x="something"; y="something"; z="something";
var image = document.getElementById("finalpic");
image.src ="http://xyz/folder/myservlet1?monthly="+monthly+"&recent="+recent+"&likes="+likes;
document.body.appendChild(image);
In return servlet produces a image which gets loaded,
I need to use url of this dynamic image to another javascript function to make a ajax/jQuery call which requires url of image.
I don’t want to produce image twice I want to use already generated image url.
FB.api('/me/photos','post', {
message:'image',
url:image
}, function(response){
How can I do this, because even when I open the generated image it get generated again and then show in tab? How to take advantage of already produced image?
According to this link and my understanding, I feel caching servlet results is a configuration stuff, and the request is not sent to the server again for processing. Sorry if am wrong about that.
http://docs.oracle.com/cd/E19528-01/819-2634/abxbu/index.html