I am getting this error when I am trying to insert data into the database through jQuery.
Error: Access to Font at ‘http://www.example.com//my-folder’ from origin ‘http://example.com’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://example.com’ is therefore not allowed access.
How can I fix this error?
My Jquery code is here:
<script> $.ajax({ type: 'post', url: site_url+'/my-URL', data: {id:id}, success: function(result){ console.log(result); } }); </script>
Question and answer is powered by AnsPress.io