Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

page (div data-role="page") data-title overridden on page reload #3292

Closed
agcolom opened this Issue · 8 comments

4 participants

@agcolom
Collaborator

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"...

http://jsfiddle.net/agcolom/8KUWU/1/show/

I realize this is not a major issue :-)

@toddparker

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?

@agcolom
Collaborator

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?

@agcolom
Collaborator

I have 2 files:

http://users.cscs.wmin.ac.uk/~coloma/jqm/try.html
and
http://users.cscs.wmin.ac.uk/~coloma/jqm/try2.html

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
http://users.cscs.wmin.ac.uk/~coloma/jqm/try.html
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...

Now try:
go to
http://users.cscs.wmin.ac.uk/~coloma/jqm/try.html
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)

And finally,
go to
http://users.cscs.wmin.ac.uk/~coloma/jqm/try.html
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.

@toddparker

Thanks for the detailed info!

@chetankjain

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.

@toddparker

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.

@jaspermdegroot
Collaborator

Is this related to #2865 ?

@jaspermdegroot
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.