We have updated WebDataRocks EULA, effective as of April 18, 2024. Learn more about what's changed.

error Access-Control-Allow-Origin


Hi, I have the exact same json file as provided on your server. only problem is, I get this message: 
Unable to open file http://pacomprojects.be/wowsync/pivot/data.json?433405660.

It seems that this file doesn’t exist or ‘Access-Control-Allow-Origin’ header is absent in the resource requested.
I can see the file in the browser and it has reading rights.

5 answers

WebDataRocks Team WebDataRocks June 12, 2019

Hi Michael!

Could you please check if DevTools (press F12) has any error message?


James July 18, 2019

You can also get this error if your data can’t be parsed for whatever reason.  I would recommend checking you can use the example data in the docs first, then after than use your own custom data.

michael July 19, 2019

Thanks for the info.
I did an extra, I wrote a script in javascript (ajax) that calls the php file. 
Problem was solved after.

moin July 16, 2020

anyone help , how to use ajax in
reportData='<?php echo $FilterReport ?>’;
var pivot = new WebDataRocks({
container: “#wdr-component”,
height: 395,
toolbar: true,
report: reportData

Hugo Martinez August 7, 2020

I think the possible issue here is the asynchronous nature of ajax call. That means you won’t have reportData loaded when it comes to new WebDataRocks execution.
In such a case, you should either create WebDataRocks instance when you are totally sure that reportData is loaded or inject the reportData into WebDataRocks instance when reportData is ready.