var title = $(r).find('title').text(); if ( title ) document.title = title;
$.ajax({ type: "POST", url: url, success: function(r){ var title = $(r).find('title').text(); if ( title ) document.title = title; } });
$.ajax({ type: "POST", url: url, success: function(r){ var title = r.replace(/[\s\S]+<title>/,'').replace(/<\/title>[\s\S]+/, ''); if ( title ) document.title = title; } });