Pjax switch fail #161

Closed
opened 2018-05-29 04:02:48 -05:00 by bihac · 7 comments
bihac commented 2018-05-29 04:02:48 -05:00 (Migrated from github.com)

Hi. I got this error on a part of my website.
"Pjax switch fail: Dom doesn't look the same on new loaded page 'title' new 0, old 1"

I have checked both pages title's and they are the same. How can i fix this issue?

Hi. I got this error on a part of my website. "Pjax switch fail: Dom doesn't look the same on new loaded page 'title' new 0, old 1" I have checked both pages title's and they are the same. How can i fix this issue?
BehindTheMath commented 2018-05-29 07:43:36 -05:00 (Migrated from github.com)

Please post a CodePen demonstrating the issue. If that's not feasible, please post the original HTML, the raw response from the HTTP call, and your Pjax configuration.

Please post a CodePen demonstrating the issue. If that's not feasible, please post the original HTML, the raw response from the HTTP call, and your Pjax configuration.
bihac commented 2018-05-29 08:46:53 -05:00 (Migrated from github.com)

There is a real time web site. You can see there.

http://radyo.comu.edu.tr

Every pjax request success but in the bottom of main page there are news (HABERLER) you can see. When i click any news link in chrome console it says : "Pjax switch fail: Dom doesn't look the same on new loaded page 'title' new 0, old 1".

There is a real time web site. You can see there. http://radyo.comu.edu.tr Every pjax request success but in the bottom of main page there are news (HABERLER) you can see. When i click any news link in chrome console it says : "Pjax switch fail: Dom doesn't look the same on new loaded page 'title' new 0, old 1".
bihac commented 2018-05-29 08:49:07 -05:00 (Migrated from github.com)

and there is pjax call:

var pjax = new Pjax({
elements: "a.ic-url",
selectors: ["title", "#main-content","#scripts"],
cacheBust :false,
});

document.addEventListener('pjax:send', displayLoader);
document.addEventListener('pjax:success', hideLoader);
and there is pjax call: var pjax = new Pjax({ elements: "a.ic-url", selectors: ["title", "#main-content","#scripts"], cacheBust :false, }); document.addEventListener('pjax:send', displayLoader); document.addEventListener('pjax:success', hideLoader);
bihac commented 2018-05-29 09:20:51 -05:00 (Migrated from github.com)

There are youtube videos in news pages as iframe. May this caused that?

There are youtube videos in news pages as iframe. May this caused that?
BehindTheMath commented 2018-05-29 13:13:02 -05:00 (Migrated from github.com)

It looks to me that the issue is being caused since one of your selectors is for the title tag, but the new page doesn't have such a tag.

It looks to me that the issue is being caused since one of your selectors is for the `title` tag, but the new page doesn't have such a tag.
bihac commented 2018-05-29 16:36:35 -05:00 (Migrated from github.com)

I m looking the both pages source code in chrome. Both have same tags including title tag. Even check when error occoures ajax response html. There is

I m looking the both pages source code in chrome. Both have same tags including title tag. Even check when error occoures ajax response html. There is <title> tag inside <head> tag. Can you check please. I couldnt even stop page load when error occoured. How can i stop page load to see console log?
bihac commented 2018-05-29 17:14:08 -05:00 (Migrated from github.com)

Sorry my bad. There was an issue on server side catching ajax actions thats why there was no title. Thanks again

Sorry my bad. There was an issue on server side catching ajax actions thats why there was no title. Thanks again
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: iLoveElysia/pjax#161