Merge pull request #967 from solgenomics/topic/expression_atlas_export
[sgn.git] / js / CXGN / Image.js
blob5ef80be49bc1fcebda22272c4a5e78195f70f27b
3 // an image object that possibly should be expanded to retrieving other stuff
4 // such as description etc... here just a stub to retrieve the html for the
5 // image itself.
7 // Author: Lukas Mueller
9 if (!CXGN) CXGN= function() {};
12 CXGN.Image = function() {
18 CXGN.Image.prototype = {
20 set_image_id: function(image_id) {
21 this.image_id=image_id;
24 get_image_id: function() {
25 return this.image_id;
28 image_html: function(div, size) {
29 new Ajax.Request('/cgi-bin/image/ajax/fetch_image.pl', {
30 method: 'get',
31 parameters: { image_id: this.get_image_id(), size: size },
32 onSuccess: function(response) {
33 var json = response.responseText;
34 //alert('JSON: '+json)
35 var r = eval ("("+json+")");
37 var html_div = document.getElementById(div);
39 html_div.innerHTML='<center>'+r.html+'</center>';
41 if (x.error) {
42 alert(x.error);
45 onError: function() {
46 alert('An error occurred! ');
48 });