I am getting a reference error while I try to call a object function, and that object function is calling another function.
For example:
I have a function to return an object;
function krPano(){
return document.getElementById("krObj");
}
Now I have a object literal that contains some helper functions that I want to use. For example:
var contextMenuInfo = {
getContextMenuCount : function(){
return KrPano().get("contextmenu").item.count;
}
}
So in getContextMenuCount func I am using KrPano() to get the object.
Now again there is another function where I call the getContextMenuCount function.
function showDifferentContextMenu(){
console.log(contextMenuInfo.getContextMenuCount());
}
When I execute this function, I get reference error saying can't find variable KrPano.
krPano()and you're calling it asKrPano(). Are you sure this typo isn't happening in your code? Function and variable names are case sensitive in javascript.Kvsk