adding title to selectors results in full page loading #231

Closed
opened 2020-11-15 12:31:04 -05:00 by BigGitWorld · 2 comments
BigGitWorld commented 2020-11-15 12:31:04 -05:00 (Migrated from github.com)

This is my simple pjax code:

 var pjax = new Pjax({
        selectors: [
            "title",
            "#content-main"
        ]
    });

If title does not exist in the above code, everything work fine (title of page does not change).
But If I add title to the selectors (such as the above), I have a full page loading!

My DOM is same and I can use jquery-pjax lib successfully.

what is the problem?

This is my simple pjax code: ``` var pjax = new Pjax({ selectors: [ "title", "#content-main" ] }); ``` If ``title`` does not exist in the above code, everything work fine (title of page does not change). But If I add ``title`` to the ``selectors`` (such as the above), I have a full page loading! My DOM is same and I can use [jquery-pjax](https://github.com/defunkt/jquery-pjax) lib successfully. what is the problem?
piperhaywood commented 2021-03-05 14:45:57 -05:00 (Migrated from github.com)

@BigGitWorld I’m running in to a similar issue and can’t seem to figure out what’s going on, were you able to sort this out?

@BigGitWorld I’m running in to a similar issue and can’t seem to figure out what’s going on, were you able to sort this out?
piperhaywood commented 2021-03-05 14:50:03 -05:00 (Migrated from github.com)

Just adding a followup: I think the issue may have been an embed on the page, perhaps Pjax is detecting multiple titles? At any rate, I added a class to the <title> tag like so: <title class="site-title"> and then used the selector title.site-title in the options and this seemed to clear it up.

Just adding a followup: I think the issue may have been an embed on the page, perhaps Pjax is detecting multiple titles? At any rate, I added a class to the `<title>` tag like so: `<title class="site-title">` and then used the selector `title.site-title` in the options and this seemed to clear it up.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: iLoveElysia/pjax#231