I'd like to be able to set an image source from a server but also have it return extra data relating to another server-side action.
I'll try to explain.
In my index.htm file I have the following in the <body> ...
<div id="BasicDemo" >
<img id="nscreen" />
</div>
<script type="text/javascript">setImageSource()</script>
The setImageSource() simply does this...
$("#nscreen").attr("src", "/control?size=800x480");
I'm not an experienced HTML coder but I'm experienced enough at coding in general to understand that the above is an implicit HTTP GET request against server-side code in order to request an image which is used to set the <img> source.
What I'd like to do in psuedo-code is...
var someResponse = getImageAndExtra("/control?size=800x480");
$("#nscreen").attr("src", someResponse.imagePath);
var extraData = someResponse.extra;
I'm not directly in control of the server-side code but I know the developer and will be working on this.
What sort of call can I use to request both an image source as well as extra data and still be able to set the "src" attribute? Also at the other end, how would the server-side code construct the response?
I can't help feeling I'm missing something really simple here.