concatenation of filter and find for a better <title> discovery

This commit is contained in:
Paolo
2013-09-18 17:33:54 +02:00
parent 9fb5f688ed
commit 28b4badb9a
3 changed files with 33 additions and 14 deletions
+3 -2
View File
@@ -376,9 +376,10 @@
updatePage: function (xhr, target) {
var t = $('#' + target);
var html = $.parseHTML(xhr.responseText, document, true);
var title = $(html).filter('title').last().text();
var title_elements = $(html).filter('title').add($(html).find('title'));
var title = title_elements.last().text();
if (title) {
$(html).find('title').remove(); /* Remove any title elements from the response */
title_elements.remove(); /* Remove any title elements from the response */
document.title = $.trim(title); /* Set the new document title */
}
var content = xhr.getResponseHeader('web2py-component-content');