0

I'm not sure what it is that I am doing wrong here. When I open the HTML code for it, it just crashes. Does anyone have any idea if my syntax is wrong, or I'm just fundamentally not understanding how the BBQ plugin works? Thanks so much!

$.bbq.pushState({ 
    lat: pointArray[0][0].lat(), 
    lng: pointArray[0][0].lng()
});

$(window).bind('hashchange', function(e) {
    var searchParams= e.getState();
    pointArray[0][0] = new google.maps.LatLng(searchParams.lat, searchParams.lng);    
    mapSearch(); 
}); 

$(window).trigger('hashchange');

In Chrome, it says that I am calling method pushState of undefined. Am I suppose to declare lat/lng outside before?

James Allardice
  • 164,175
  • 21
  • 332
  • 312
  • My only guess would be that BBQ isn't yet loaded when this runs. Are you sure the script tag for the BBQ plugin is before this script? – josh3736 Jul 22 '12 at 04:39
  • It is. Well, I'm not sure what was wrong earlier, but I moved that block of code a little bit more down but now the problem is that the mapSearch() function isn't being called. The URL has been changed, but the block of code for hashchange isn't happening. – user1517446 Jul 22 '12 at 05:06
  • Actually, never mind. I forgot to getState to set my starting location. Thanks so much for your help! – user1517446 Jul 22 '12 at 05:55

0 Answers0