ok so i have a js object declared at the top of my js file and at the bottom i have a function that is creating a property and adding a value to it but when i go to console log the new property in a different function it returns undefined but if i log the whole object it shows the object and the new property with its value below is the code:
$(document).ready(function(){
var allVars={};
contentJson();
bioPageClass();
//start bioPage code.
function bioPageClass(){
console.log(allVars.nums)
//allVars.bioContent=allVars.allContent.theComittee.bios;
allVars.timeTxt=allVars.allContent.theComittee.timeline;
mouseEx();
bioInfo(0);
$('#next').click(function(){
var itsindex = inkDot($('.dot').index($('.filled'))+1);
});
$('#pre').click(function(){
var itsindex2 = inkDot($('.dot').index($('.filled'))-1);
});
function inkDot(dots){
$('.dot').removeClass('filled');
var equalize = dots < 0 ? 0 : dots;
if(equalize <= $('.dot').length -1){
$('.dot:eq('+equalize+')').addClass('filled');
console.log('1st if '+equalize);
bioInfo(equalize);
}else{
equalize=0;
console.log('the else '+equalize);
$('.dot:eq('+equalize+')').addClass('filled');
bioInfo(equalize);
}
}
function mouseEx(){
$(".TLBtn").mouseover(function(){
if(!$(this).hasClass('clkd')){
$(this).addClass("timeROver");
}
}).mouseout(function(){
if(!$(this).hasClass('clkd')){
$(this).removeClass("timeROver");
}
});
$(".TLBtn").click(function(){
$(".TLBtn").removeClass('clkd timeROver');
$(this).addClass('clkd timeROver');
})
}
function timeLineInfo(){
}
function bioInfo(ix){
$('.bioCon').fadeOut(100, function(){
$('#bioImage > img').attr('src',bioContent[ix].image);
$('#bioName').html(allVars.bioContent[ix].name);
$('#bioTitle').html(allVars.bioContent[ix].title);
$('#bioDisc').html(allVars.bioContent[ix].details);
$('.bioCon').fadeIn();
});
}
}
//end bio page code.
//call content json.
function contentJson(){
$.getJSON("content.json", function(json){
allVars.allContent = json;
allVars.nums = 8000;
});
}
});
what i'm i doing wrong here???
console.logwithalert, is the output correct?.readycommand has fired (after the DOM is loaded)