Javascripts and Access-Control-Allow-Origin

Popular automatic website translation tool

Javascripts and Access-Control-Allow-Origin

Postby Willard1975 » Mon Jun 06, 2016 3:12 pm

Hello

I have the same issue as discussed in this thread. I have added the following to my .htaccess file:

Code: Select all
<FilesMatch "\.(ttf|otf|eot|woff|woff2|js)$">
    <IfModule mod_headers.c>
        Header set Access-Control-Allow-Origin "*"
    </IfModule>
</FilesMatch>


However the Widgetkit slider does not appear when i switch languages. If i temporarily disable the caching on Cloudflare it works in Chrome only. I have tested in all browsers and it's the same in all. You can see the site here and look in the various consoles when switching language.

I don't know what to do anymore.

Regards
Michael
Willard1975
 
Posts: 5
Joined: Sun Jul 12, 2015 4:21 pm

Re: Javascripts and Access-Control-Allow-Origin

Postby Yana » Mon Jun 06, 2016 5:30 pm

Hi,
I can see the following in console
Code: Select all
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://travelshop.se/media/widgetkit/widgets/lightbox/js/lightbox.js?wkv=1.4.9?wkv=1.4.9. (Reason: missing token 'x-requested-with' in CORS header 'Access-Control-Allow-Headers' from CORS preflight channel).
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://travelshop.se/media/widgetkit/widgets/slideshow/js/slideshow.js?wkv=1.4.9?wkv=1.4.9. (Reason: missing token 'x-requested-with' in CORS header 'Access-Control-Allow-Headers' from CORS preflight channel).
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://travelshop.se/media/widgetkit/widgets/mediaplayer/mediaelement/mediaelement-and-player.js?wkv=1.4.9?wkv=1.4.9. (Reason: missing token 'x-requested-with' in CORS header 'Access-Control-Allow-Headers' from CORS preflight channel).
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://travelshop.se/media/widgetkit/widgets/spotlight/js/spotlight.js?wkv=1.4.9?wkv=1.4.9. (Reason: missing token 'x-requested-with' in CORS header 'Access-Control-Allow-Headers' from CORS preflight channel).


Please try to add the following instead

Code: Select all
<IfModule mod_headers.c>   
    Header set Access-Control-Allow-Origin *
</IfModule>
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4547
Joined: Thu Jan 12, 2012 6:21 pm

Re: Javascripts and Access-Control-Allow-Origin

Postby Willard1975 » Mon Jun 06, 2016 6:15 pm

Hi

I tried that earlier as well but it didn't work. But i added that code back now, purged cloudflare and Joomla cache. It's not working here as far as i can see. Is it working for you?

/Michael
Willard1975
 
Posts: 5
Joined: Sun Jul 12, 2015 4:21 pm

Re: Javascripts and Access-Control-Allow-Origin

Postby Yana » Mon Jun 06, 2016 7:39 pm

Hi,

It works only with Google Chrome.
Please check the following post
widgetkit-and-gtranslate-problem-t4317.html?hilit=widgetkit#p19185
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4547
Joined: Thu Jan 12, 2012 6:21 pm

Re: Javascripts and Access-Control-Allow-Origin

Postby Willard1975 » Tue Jun 07, 2016 11:13 am

If you look at my original post i have read that thread already.

Is there a way to switch from sub-domains to sub-directory easily? If i change it now everything results in a 404 error. Also will Google still index the site in different countries if i switch?
Willard1975
 
Posts: 5
Joined: Sun Jul 12, 2015 4:21 pm

Re: Javascripts and Access-Control-Allow-Origin

Postby Willard1975 » Tue Jun 07, 2016 1:29 pm

Never mind i solved it. The following was needed in .htaccess:

Code: Select all
<FilesMatch "\.(ttf|otf|eot|woff|woff2|js)$">
    <IfModule mod_headers.c>
        Header set Access-Control-Allow-Origin "*"
   Header set Access-Control-Allow-Headers "Accept, X-Requested-With"
    </IfModule>
</FilesMatch>


/Michael
Willard1975
 
Posts: 5
Joined: Sun Jul 12, 2015 4:21 pm

Re: Javascripts and Access-Control-Allow-Origin

Postby Yana » Tue Jun 07, 2016 5:29 pm

Hi,

Thanks for sharing your experience!
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4547
Joined: Thu Jan 12, 2012 6:21 pm


  • Related Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests

cron