I have a simple function for loading php pages into the index.php file. I'm wanting to incorporate pushstate() so I can start making the page crawlable. But not sure how.

Here's my starting point (which just gives me "http://www.site.com/undefined"

// function for navigation clicks

    $("#top_nav li a, #footer_info").on("click", function(e){

                // prevent the a href from doing what it naturally does.

                // highlight active nav link & turn off others              

                // which page chosen?
                var loadpage = 'inc/'+$(this).attr('name')+'.php';
                var footer = 'inc/footer.php';

                    $('#main_center_box,#footer_links').stop().animate({ opacity: 0, zIndex:0 }, 700, function() { 

                        // now load the page that matches navigation selected
                        $('#main_center_box').css({zIndex:1 }).load(loadpage).stop().animate({ opacity: 1}, 700, function() { /* animation complete */ });

                        // not sure how to do this part...
                        href = $(this).attr(loadpage);
                        history.pushState('', 'New URL: '+href, href);


good lord...

It helps if I have a url in the href.

Ok. that's solved. Now how to make things crawlable.