If you specify data-title="myTitle" to a div with data-role="page", when you go to that page, the title displayed is myTitle. However, if you reload the page, the document title displayed is the title defined in the title tag, between <title> and </title>. If no document title is defined, it is the filename that gets displayed. The same happens when you directly type URL to access the page. Even if you display page one, it is the document title that gets displayed (or the filename if there is no document title) I have created a fiddle to illustrate, although the fiddle title replaces the document title, but otherwise seems to behave as expected when going to page "two" or then to page "one"...
I realize this is not a major issue :-)
So this is only an issue if you have a multi-page doc and you navigate to an inner page that has a data-title and refresh. Is that right?
Actually, even going to a page with one single inner page (with data-role page) will not display the data-tile either. The data-tile actually never gets displayed unless you navigate to one of the inner pages from another inner page inside the same file. I can host two files with various combinations if that helps?
I have 2 files:
try.html is a multipage. going to page "two" shows the correct title. From there, going to "one" shows the correct title.
Now, try the following:
go to page "two"
go to page "one"
go to "non-existent" page with data-rel="back" (shows correct title for page two)
go to "non-existent" page with data-rel="back" (shows correct title for page one)
so that was all correct...
go to page "two"
go to "non-existent" page with data-rel="back" (although we moved to page one, the title did not change and it is the title for page two that is displayed)
if you click on the "link" word in the text, you go to try2.html#one and no title gets displayed (the doc has no title, but data-tile is in the page tag, but as I have rel="external", I suppose this is normal, and follows what is described in the docs.
Thanks for the detailed info!
toddparker, agcolom, I had played with data-title sometime back and had written how things behave and my opinions on the same in my blog here: http://goo.gl/kcE41 with further links to a post about titles in single-page and multi-page template. Just adding my 2 cents to this issue and sharing my findings.
I agree on 1-3, but the header may not be there at all depending on your design - that is how it's supposed to work so we should fix any issues with this behavior. There is a character limit on headers that shouldn't be imposed on the title.
Is this related to #2865 ?
Closing as duplicate of #2865
Edit: Actually the fix for #2865 is the cause of this issue. That ticket has been reopened and I changed the title. I prefer to keep that issue open instead of this one, because it contains links to related commits.