fixed an infamous comma error (makes the javascript crash in Explorer...)
[cxgn-jslib.git] / CXGN / Image.js
blob855aeff72768ef39623e432f571bc99f2868b52e
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 parameters: { image_id: this.get_image_id(), size: size },
31 onSuccess: function(response) {
32 var json = response.responseText;
33 //alert('JSON: '+json)
34 var r = eval ("("+json+")");
36 var html_div = document.getElementById(div);
38 html_div.innerHTML='<center>'+r.html+'</center>';
40 if (x.error) {
41 alert(x.error);
44 onError: function() {
45 alert('An error occurred! ');