1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-24 10:22:23 +00:00

edit document title

This commit is contained in:
ruanyf 2014-04-22 09:45:58 +08:00
parent 44ff6ee6dd
commit d01d783cf9

View File

@ -186,7 +186,7 @@ function router() {
$.get(path , function(data) {
$(ditto.error_id).hide();
$(ditto.content_id).html(marked(data));
if ($(ditto.content_id h1) === ditto.document_title){
if ($(ditto.content_id+" h1").text() === ditto.document_title){
document.title = ditto.document_title;
} else {
document.title = $(ditto.content_id h1).text() + " - " + ditto.document_title;