I am using Firebug, and everything works fine in FF, Safari, Opera, and even IE 8. Something about IE 7 though is throwing that error and I can't for the life of me track what it is. :(
On Nov 17, 9:19 am, Michel Belleville <[email protected]> wrote: > Well, when I've got an error saying something is null or not an object, and > that very something is obtained from a query response, first thing I do is > checking what was the response. Firebug may help if you're not using it > already, and my shot in the dark here would be to think you've either > received something you didn't expect, or in a format you didn't exepct, or > that the data.items[0].background didn't fit the provided format. > > Michel Belleville > > 2009/11/17 roryreiff <[email protected]> > > > //This code is withing a larger function, but the error is coming into > > play when the 'ppButton' is clicked > > // It throws the following error in IE 7 (6 not yet tested): > > // > > // Error: 'data.items[...].background' is null or not an object > > // Code: 0 > > // > > > var PP = $('.pomonaPeople'); > > > $.getJSON("/dev/home/pp.json", > > function(data){ > > PP.css('background', 'url(' + data.items[0].background + > > ' )' ); > > > // create navigation > > var ppButton = $('#pp-nav ul li a'); > > ppButton.qtip({ style: { name: 'pomonastandard', 'font- > > size': '70%', tip: true }, position: { adjust: { mouse: true, x:0, y: > > 0, screen: true }, corner: { target: 'topRight', tooltip: > > 'bottomLeft'}} }); > > var currentPP = PP.find('#pp-0'); > > > ppButton.click( function(event) { > > event.preventDefault(); > > var ppDivs = PP.children('div'); > > var aIndex = $(this).attr('href'); > > var destination = PP; > > destination.append('<div class="loading"></div>'); > > var aIndexBG = data.items[aIndex].background; > > destination.css('background', 'url(' + aIndexBG + > > ' )' ); > > // set z-index of current div to be above others, and > > reset rest > > currentPP.css('z-index', '100'); > > currentPP = $('#pp-' + aIndex); > > //console.log(currentPP); > > currentPP.css('z-index', '125'); > > destination.find('.loading').fadeOut(FADE); > > }); > > > PP.find('.loading').fadeOut(FADE); > > > });

