access control allow origin error

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Wed Jan 21, 2015 12:23 pm
Reply with quote
Report this post
Dear sirs,

I have installed the creativity template and if I try to load the page it seems to be loading just fine.
http://www.bfcgroup.gr.

However the developer tools reports the following errors:
Code: Select all
Uncaught TypeError: undefined is not a function
index.php:1 XMLHttpRequest cannot load http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://www.bfcgroup.gr' is therefore not allowed access.
index.php:1 XMLHttpRequest cannot load http://fonts.googleapis.com/css?family=Ubuntu:300,400,700,300italic,400italic,700italic&subset=latin,greek. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://www.bfcgroup.gr' is therefore not allowed access.
index.php:1 XMLHttpRequest cannot load https://s3-eu-west-1.amazonaws.com/assets.cookieconsent.silktide.com/current/style.min.css. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://www.bfcgroup.gr' is therefore not allowed access.
index.php:1 XMLHttpRequest cannot load http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://www.bfcgroup.gr' is therefore not allowed access.
index.php:1 XMLHttpRequest cannot load http://fonts.googleapis.com/css?family=Ubuntu:300,400,700,300italic,400italic,700italic&subset=latin,greek. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://www.bfcgroup.gr' is therefore not allowed access.
index.php:1 XMLHttpRequest cannot load https://s3-eu-west-1.amazonaws.com/assets.cookieconsent.silktide.com/current/style.min.css. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://www.bfcgroup.gr' is therefore not allowed access.


According to this http://stackoverflow.com/questions/25694456/google-fonts-giving-no-access-control-allow-origin-header-is-present-on-the-r all I need to do is add the
Code: Select all
 data-noprefix
tag to each line tha loads the fonts (I guess the same should go for the cookie concent plugin that produces the same error)

I do not see how I can add this other than using the rereplacer plugin but I prefer a better solution.

I would like this resolved as it also appears at the google bots crawls and that causes lower page ranking.

Thank you.
User avatar
Senior Boarder

GK User
Thu Jan 22, 2015 7:54 am
Reply with quote
Report this post
I'm affraid this is not a template or Joomla problem. I guess it is some server specific restriction. I have just tested our demo server, my local server and your site and with exactly same configuration only your site gives the problem. Please check it by placing simple index.html file with basic html markup and link to google font as it is provided by google it self. It should prove the problem is somewhere else.
User avatar
Moderator

GK User
Thu Jan 22, 2015 9:27 am
Reply with quote
Report this post
Well if it was a server side misconfiguration I suppose that https://www.bfcgroup.gr/test_fonts.html would give the same problem.

However the page loads fine. I suppose that some conflict occurs with the gavick index.php but I am having a hard time figuring out what. Is there a way to get some more info on the issue?
User avatar
Senior Boarder

GK User
Fri Jan 23, 2015 5:40 pm
Reply with quote
Report this post
Ok, lets do one more thing - please update your template to current version and disable js compression (in template settings and in any 3rd party plugin you might be using.
User avatar
Moderator

GK User
Fri Jan 23, 2015 8:33 pm
Reply with quote
Report this post
I've seen the update news only I don't know how to apply it. Is there an update guide for gavick themes?
User avatar
Senior Boarder

GK User
Mon Jan 26, 2015 5:03 pm
Reply with quote
Report this post
This might be handy:
https://www.gavick.com/documentation/jo ... k-template
https://www.gavick.com/forums/140/updat ... work-15140
In a short:
1. Backup template catalog (I would suggest to do a whole Joomla files and database backup).
2. Use either extension manager or overrite template folder with ftp.
3. Bring back override.css if you have used it.
4. If you have made any changes to other files (than override.css) you need to merge them manually.
User avatar
Moderator

GK User
Thu Apr 23, 2015 5:56 pm
Reply with quote
Report this post
I have made the latest updates to the template and the errors are still there. Could you please look it up and guide me to resolve it?
User avatar
Senior Boarder

GK User
Mon Apr 27, 2015 6:45 am
Reply with quote
Report this post
Could you please post an url to your site again?
User avatar
Moderator

GK User
Mon Apr 27, 2015 9:29 am
Reply with quote
Report this post
The site is located at www.bfcgroup.gr
User avatar
Senior Boarder

GK User
Mon Apr 27, 2015 7:31 pm
Reply with quote
Report this post
This is really weird. I see a lot of cloud/3rd party solutions on your site. Please disable modules one by one (3rd party, also those configuring your's cloud service), perhaps one of them is causing the issue?
User avatar
Moderator

GK User
Tue May 05, 2015 4:37 pm
Reply with quote
Report this post
Have disabled all minification and cache modules and plugins. Also disabled cloudflare but site is still served through that. It's my NameServer. Can't really disable that 100%. Just make it inactive. However even with everything off the issue persists. Besides even when I first installed the theme without any addons or even cloudflare, I noticed these errors. Just at the time I thought that I could deal with it later.... :D
User avatar
Senior Boarder

GK User
Tue May 05, 2015 9:18 pm
Reply with quote
Report this post
Something must be modifying the way google fonts are loaded.
If you check with devtools/firebug, strange data-inprogress parameter is added, and it is something that our template doesn't do by default.
Could you please on the same server in a subdomain or subfolder install quickstart of Creativity template again, but do not do any changes after installation?
User avatar
Moderator

GK User
Sat May 09, 2015 10:47 am
Reply with quote
Report this post
Ok I've found the culprit!

It was a setting in the advanced section of the template named: "Use prefixfree"
I am not sure what it does but it seemed to me that it makes the site difficult to debug so I had it enabled. Never though it was a cache thingie so I was always having it on.

Why does that cause issues?

Also I now see a real error. on this thread here you disabled it: https://www.gavick.com/forums/news2-joo ... d-ie-42055

I am receiving the same error for the fitvids function. Why am I getting this error?

Here is the code

Code: Select all
   jQuery(document).ready(function(){
         // Target your .container, .wrapper, .post, etc.
         jQuery("body").fitVids();
   });


Even when I turn off all caching this error is right there. It is loaded on index.php (When I turn on caching it is loaded on a cached .js file) but it produces the same error always.

Any solution to that? I do not wish to turn it off for now.

Thank you
User avatar
Senior Boarder

GK User
Sat May 09, 2015 12:02 pm
Reply with quote
Report this post
You can learn more about prefixfree:
https://www.gavick.com/documentation/jo ... d-settings
http://leaverou.github.io/prefixfree/

And if it goes to fitVids - it was known error some time ago... Please check if your template is updated.
User avatar
Moderator

GK User
Mon May 11, 2015 10:15 pm
Reply with quote
Report this post
Yes I have the latest version. When I go into the template manager and go into updates I get "you have the latest version"

I will also take this chance to ask you another question that is rather more urgent.

I have the quotes set up here for the main language of my website (greek-helenic): http://www.bfcgroup.gr/el#gkBottom1-1
As you can see they slide in from two sides and they look fine.

However when copying the module in the english version to make the site multilingual On the english version the quotes appear messed up on top of the contact us module: http://www.bfcgroup.gr/en#gkBottom1-1

I suppose it's a css issue. Could you help me out to figure out why this happens?

(If I get the english module and use it on the front page of the greek version it appears perfectly fine! When I take it to show up on the english page it shows up messed up.)
User avatar
Senior Boarder

GK User
Tue May 12, 2015 12:35 pm
Reply with quote
Report this post
Concerning the module positions mess, I have started a new thread here: https://www.gavick.com/forums/creativit ... ages-45640
User avatar
Senior Boarder

GK User
Tue May 12, 2015 4:56 pm
Reply with quote
Report this post
Ok - are all questions answered or something still remains?
User avatar
Moderator

GK User
Tue May 12, 2015 4:58 pm
Reply with quote
Report this post
The fitvids issue is not resolved. I use the latest version but I still get the error.
User avatar
Senior Boarder

GK User
Tue May 12, 2015 5:04 pm
Reply with quote
Report this post
Could you please temporally disable js compression?
User avatar
Moderator

GK User
Tue May 12, 2015 5:07 pm
Reply with quote
Report this post
I've tried that. I noted that on my previous post.
It's a live site. I can't really disable accelerators for too long.
User avatar
Senior Boarder

GK User
Tue May 12, 2015 5:08 pm
Reply with quote
Report this post
Just do it and let me know, I'll check it in few minutes.
User avatar
Moderator

GK User
Fri May 15, 2015 9:15 am
Reply with quote
Report this post
Dear Sir,

I was unable to tend to the matter the previous days and that's why I haven't replied back.

I will be able to disable compression and accelerations today. Will you be available too?
As soon as you reply to the post I will remove optimizations and let you take a look.

Thank you
User avatar
Senior Boarder

GK User
Sun May 17, 2015 10:45 am
Reply with quote
Report this post
Please write back again when you will be able to do so.
User avatar
Moderator

GK User
Sun May 17, 2015 11:38 am
Reply with quote
Report this post
We can try this again on Tuesday. About the same time as on Friday.
User avatar
Senior Boarder

GK User
Sun May 17, 2015 12:12 pm
Reply with quote
Report this post
Ok, then please write in this thread on Tueasday. If I will be available we can try.
User avatar
Moderator

GK User
Sat May 23, 2015 11:36 am
Reply with quote
Report this post
I have set up the Univercity template on another cpanel on my vps and I got the same error (fitvids) on the page: http://www.gshp.eu/index.php/contact

I also got the tooltip error as follows:
Uncaught TypeError: jQuery(...).tooltip is not a function
Uncaught TypeError: jQuery(...).fitVids is not a function

On that page I have no acceleration addons or anything other than the quickstart installation. Could you look it up here? it will probably be similar to the problem on bfcgroup.gr so...
User avatar
Senior Boarder

GK User
Tue May 26, 2015 4:50 pm
Reply with quote
Report this post
From what I see the problem is because of the content of this page. jQuery is loaded in header, then again you load jQuery in content making some of the functions to break. Please remove jquery from content code and all should work fine.
User avatar
Moderator

GK User
Tue Jun 09, 2015 1:03 pm
Reply with quote
Report this post
The Suggestion you gave worked immediately. I removed the jquery that was needed for the google map, since the template already loaded a jquery the map is still working as well as no errors appear.

Testing the http://www.bfcgroup.gr I see 2 jqueries being loaded.
one is /media/jui/js/jquery.min.js
and one is the normal google jquery 1.7 at https://ajax.googleapis.com/ajax/libs/j ... ery.min.js

Now I'd like to try to disable one of those. Prolly the one loaded by jui should be disabled but I don't know who jui is!

Since the template is a quick install without any added modules (except jchoptimize but that doesn't load jquery) could you please tell me which module from the template loads jquery from the folder /media/jui?

Update: I should have known that /media/jui/jquery.min.js is the native joomla jquery. So the excess jquery is the one loaded from google? or should I disable joomla's jquery?

(I thought that joomla 3.4 no longer loaded jquery... only mootools... I should get my facts straight. I misread the news at some point)
User avatar
Senior Boarder

GK User
Wed Jun 10, 2015 11:13 am
Reply with quote
Report this post
This is not an easy issue ;). Joomla based jquery probably differs from the second one. There is a Joomla plugin which tries to manage all the jQuery version and use it only once as long as it is injected by template or module:
http://extensions.joomla.org/extension/jquery-easy
But I don't think it will work with jQuery included in content itself.
User avatar
Moderator

GK User
Wed Jun 10, 2015 2:07 pm
Reply with quote
Report this post
I don't have jquery in content here: www.bfcgroup.gr
User avatar
Senior Boarder

GK User
Sat Jun 13, 2015 3:35 pm
Reply with quote
Report this post
Yeah you don't, but you have jequery loaded in header as a separate library:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
and again in compressed js:
jQuery v1.11.2

And that is a base of the problem.
User avatar
Moderator

GK User
Sun Jun 14, 2015 7:56 pm
Reply with quote
Report this post
So what we need to find out is who loads one lib and who loads the other?
User avatar
Senior Boarder

GK User
Tue Jun 16, 2015 2:47 pm
Reply with quote
Report this post
I found a solution. It seems that the newsshowpro module has the loading the jquery library from external source activated by default.

disabling that no longer loads the jquery 1.7 and now the page only loads the jui jquery. Apart from gaining like half a second of loading time, I also no loger receive the error.

Maybe you should look this up as both jquery libraries are loaded either by joomla or by a module provided by gavick.
For some reason the "force the jquery loading by the module if the template does not include it" does not work as it should and does not take into account the fact that joomla 3.4 loads a version of jquery.
User avatar
Senior Boarder

GK User
Wed Jun 17, 2015 7:12 pm
Reply with quote
Report this post
Joomla itself should not load jQuery afaik. Perhaps the problem is somewhere else, but thanks for pointing it out.
User avatar
Moderator

GK User
Thu Jun 18, 2015 2:04 am
Reply with quote
Report this post
well according to this: http://eorisis.com/blog/javascript-fram ... n-joomla-3

Joomla loads the latest version

I think that mootools is not loaded by default in the latest joomla versions.
User avatar
Senior Boarder

GK User
Sat Jun 20, 2015 3:14 pm
Reply with quote
Report this post
Well, still I'm not 100% sure. If no plugin or template uses jQuery - it simply should not load.
User avatar
Moderator


cron