Skip to main content

Access-Control-Allow-Origin Issue with D3.js

Hello,

I am not sure if this is the right place - I can't seem to find anywhere to submit a support question (even under the "Questions" section). Sorry if this is the wrong spot!

I am using D3.js, a data visualization library, to create a map. On my nationbuilder site, it loads data asynchronously through AJAX. My site is funderstogether.org.

I am having trouble configuring nationbuilder to load these resources without triggering access errors. In preview mode, which loads resources through funderstogether.nationbuilder.org, the script works. However, in published mode (which uses funderstogether.org/myD3script, for example), the script breaks, citing an issue with Access-Control-Allow-Origin. This surprise seems to defeat the purpose of a preview mode. How can I configure nationbuilder to load these resources from funderstogether.org/*.js instead of funderstogether.nationbuilder.com? 

Here is the console error: 

"XMLHttpRequest cannot load http://funderstogether.nationbuilder.com/themes/1/52cd4c2801925b740b000002/0/attachments/13896789921390712899/default/states.js. The 'Access-Control-Allow-Origin' header contains the invalid value '*.funderstogether.org'. Origin 'http://www.funderstogether.org' is therefore not allowed access."

Thank you for any help you're able to provide!

 

 

Official response from

Please see below for suggestions! 

Share this post

Showing 4 reactions

How would you tag this suggestion?
Please check your e-mail for a link to activate your account.