-
-
Notifications
You must be signed in to change notification settings - Fork 474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loading subdomains #46
Comments
https://en.wikipedia.org/wiki/Same-origin_policy What were they thinking?! Is there a workaround that can work with Barba? |
Hello @ideaprison . From the documentation:
|
Ugh, how idiotic.. Thanks for the fast respons though, at least I know what the problem is now. |
You may try some some crazy thing like:
Then on the page load, if you detect the hash #url, redirect to that url. Of course this would imply a fork of barba.js and modify some core functions like the onpopstate change and etc. But it's the only way I think if you want to keep different subdomain. Anyway it's strange that you have that error, ideally when barba.js can't do the pushstate should redirect to that url: https://github.com/luruke/barba.js/blob/master/src/Pjax/Pjax.js#L224 I will try to do some testing :) |
Oh, you're right it did forward to the page, I disabled your check to see if I could get it to work with the subdomain loading. |
@ideaprison did you pursue this any further? I was hoping to do something similar. |
There isn't a pretty workaround at this time. But depending on your transition animation. Hope I'm making sense. |
OK, thanks for letting me know. So if I'm understanding correcting, assuming you were only concerned with external links, there'd probably be no reason to include Barba in the above scenario. Right? |
Correct. Then you could just rewrite your links a bit with something like:
|
I have a site setup that divides each section of the site in a subdomain.
Everything for that works like a charm but when trying to use Barba to ajax load subdomain pages I run into "Access-Control-Allow-Headers" issues. I managed to get rid of those problems except,
pushState: "SecurityError: DOM Exception 18: The operation is insecure." won't allow it.
Is there a way to solve this?
Example:
User is on 'journal.site.com' and clicks the menu item that goes to 'about.site.com'
The text was updated successfully, but these errors were encountered: