/* For brevity, the name space manger code is omitted
My object is video in the xy.widget.video. The lines that give
error are preceded by -->
*/
xy.widget.video.video = Class.create({
dataLength: '',
initialize: function(){
//use any url here.
getVideos(url);
},
getVideos: function(url){
new Ajax.Request(url, {
method: 'get',
requestHeaders: {
Accept: 'application/json'
},
onSuccess: handleResponse,
onFailure: function(){
alert('Something went wrong while executing
getVideos.')
}
});
},
handleResponse: function(json){
var jsonData = json.responseText.evalJSON(true);
// none of the followings is working
----> dataLength = jsonData["items"].length;
----> this.dataLength = jsonData["items"].length;
},
});
var myVideo = new xy.widget.video.video();
Thanks in Advance