No Access-Control-Allow-Origin header

No Access-Control-Allow-Origin header

Today, We want to share with you No Access-Control-Allow-Origin header.
In this post we will show you How to solve – No ‘Access-Control-Allow-Origin’, hear for How to fix Access-Control-Allow-Origin (CORS origin) we will give you demo and example for implement.
In this post, we will learn about ERROR : No “Access-Control-Allow-Origin” header is present with an example.

Error: “No Access-Control-Allow-Origin header” is some data present on the data requested main resource.

How to solve – No ‘Access-Control-Allow-Origin’ – Syntax

The simple used in server side Access-Control-Allow-Origin some response Data header indicates some results whether the data response can be more shared with data resources with the given PHP, .net, webapi, C#, etc. origin.

Read Also:  PHP Block IP addresses access for specific IP addresses

Access-Control-Allow-Origin: *
Access-Control-Allow-Origin: 

PHP SET- Access-Control-Allow-Origin

If you are using Latest <b.Node.js, For used to:

app.use(function(req, res, next) {
    res.header("Access-Control-Allow-Origin", "*");
    res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
    next();
});

For c# web services – webapi

Please put the following source code in your App web.config simple file under C# tag tag.

Please create sure you are not any access doing any some mistake in the jquery ajax call

Read Also:  Access Control Allow Origin http set Headers

jQuery

$.ajax({
    url: 'http://live24u.com/api/mycall',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded'
    }, 
    type: "POST", /* methods or type:"GET" methods or type:"PUT" methods */
    dataType: "json", //dataType
    data: {
    },
    success: function (data) {
        console.log(data);    
    },
    error: function () {
        console.log("error");
    }
});

Mixed Content: The page was not data loaded over HTTPS. This some request has been blocked.

In some order to fix an issue for your WordPress website or ay blog, just put simple below source code into your root .htaccess file.

.htaccess

  
    Header set Access-Control-Allow-Origin "*"
  

As you Display Access-Control-Allow-Origin “*” some allows you to all the file access all folder and files resources and webfonts from all this domains.

Read Also:  PHP CodeIgniter 3 Generate Random record from mysql

We hope you get an idea about No ‘Access-Control-Allow-Origin’ solve this error header is present
We would like to have feedback on my Information blog .
Your valuable any feedback, Good question, Inspirational Quotes, or Motivational comments about this article are always welcome.
If you liked this post, Please don’t forget to share this as Well as Like FaceBook Page.

We hope This Post can help you…….Good Luck!.


Related FAQ

Here are some more FAQ related to this Article:

  1. Read Also:  jquery drag and drop save to database php
  2. Read Also:  PHP Generate HTML file into PDF
  3. Read Also:  Nested try catch block in PHP - Exception handling
  4. Read Also:  PHP Laravel Redirect To Another URL without http of Other site
  5. Read Also:  how to upload image in php and store in database and folder?
  6. Read Also:  failed to load resource: the server responded with a status of 404 (not found)
  7. Read Also:  jQuery CKEditor Validation Example with demo
  8. Read Also:  Angular 6 Registration and Login System Example Tutorial
  9. Read Also:  Cross Header Access Control Allow Origin missing
  10. Read Also:  PHP Generate HTML file into PDF