1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
var Album = Class.create( {
initialize : function(baseScript, elementId) {
this.baseScript = baseScript;
this.contentElt = $(elementId);
},
hello : function() {
alert(this.baseScript);
alert(this.contentElt);
},
listAlbums : function() {
new Ajax.Request(this.baseScript + "?action=allalbums", {
method :'get',
onSuccess : function(transport) {
this.contentElt.innerHTML = transport.responseText;
},
onFailure : function() {
alert('Something went wrong...')
}
});
}
}); |