Hi everybody,
as usual i come here after testing around for hours and not having any clue what i am doing wrong ;-) I am not an javascript expert so i suppose this will cause some rolling eyes ;-) Sorry about that. I am now at a point where i tried to code somehting in a more readable way. Seperating functions in classes etc... What i want to achieve is something like this:
modules.create('streamModule','leftColumn')
which will call
streamModule.create()
NOW THE THING I DONT GET TO WORK:
Calling modules.create('streamModule','leftColumn') always results in
Reference Error: leftColumn is not defined???
The id in the call: eval(type +".create("+id+","+target")"); is always passed correctly but the target parameter is not??? What am i doing wrong?
Any help would be very very appreciated!!!!! Thank you!
var modules = {
_map : [],
create: function(type,target) {
if(type == undefined) return false;
if(target == undefined) return false;
//Store id in map
this._map.push(id = createID());
//Call create function of module
eval(type +".create("+id+","+target")");
}
}
[...]
var streamModule = {
create: function() {
$.log(target)
}
}
[...]
modules.create('streamModule','leftColumn')