Access to XMLHttpRequest has been blocked by CORS policy

My website URL is:

What I’m seeing is:
error message
Access to XMLHttpRequest at ‘htt ps://’ (redirected from ‘htt p://,job_type,account_name,tot_ctc,tot_val&table=vw_tot_invoice_values&_=1584999729266’) from origin ‘htt p://’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

jqx-all.js:17 GET htt ps:// net::ERR_FAILED

I’m using this software:
Chrome browser Version 80.0.3987.149 (Official Build) (64-bit)

Additional information:
The error occurs on loading the site main page, which itself uses a javascript file trying to retrieve data from the database (relevant code below):

var url = ‘…/data.php?queryType=’+qryType+’&flds=’+selectFlds+’&table=’+tbl;
var invoiceSource = {
datatype: “json”,
datafields: [
{ name: ‘invoice_year’, type: ‘string’},
{ name: ‘job_type’, type: ‘string’},
{ name: ‘account_name’, type: ‘string’},
{ name: ‘tot_ctc’, type: ‘number’},
{ name: ‘tot_val’, type: ‘number’}
url: url,
root: ‘data’,

If i change the url value to:
http s://’+qryType+’&flds=’+selectFlds+’&table=’+tbl;

I get the error below:

jqx-all.js:17 GET,job_type,account_name,tot_ctc,tot_val&table=vw_tot_invoice_values&_=1584999947004 net::ERR_SSL_PROTOCOL_ERROR

The site I am trying to build uses XMLHttpRequest to get data from/to the database. How can I resolve this issue?


if you want to use phpmyadmin, you can use it in cpanel :slight_smile:

The reason you see that error is because some of pages are missing.


Thanks for your reply. It looks like this can be resolved by using the full path in the “url” variable

In my case, the data.php file is in a folder called phpmysql, saved inside the home folder, so I changed the url value to:

var url = ‘’+qryType+’&flds=’+selectFlds+’&table=’+tbl;

This now seems to work

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.