change page title with ajax returns undefined

i need to get title of “href” variable

  var href = $(this).attr('href');
    $(this).click(function(event){
        event.preventDefault();
        $.ajax({
            url: href,
            success:function(response){
                document.title = $(response).find('title').html();
                window.history.pushState('', '', href);
            },

        })
    })

change url works carefully.
but the page title show undefined


Source: ajax

Leave a Reply