Home > Jobs > Technology > AngularJS > No Access-Control-Allow-Origin header

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.

Also Read :  PHP and Ajax Asynchronous File Upload using jQuery

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

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.

Also Read :  Laravel Ajax Autocomplete Search Box Example

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 "*"
  

:: Related Posts ::

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.

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.

Also Read :  Laravel check if ajax request or not example

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

Jaydeep Gondaliya
Hi, I’m Web developer, PHP developer.Pakainfo.com is the most popular Programming & Web Development blog. Our mission is to provide the best online resources on programming and web development.Any visitors of this site are free to browse our tutorials, live demos, Examples and download scripts.If you have a project that you want to get started, launch quickly, contact me. Email : [email protected]
https://pakainfo.com/

Leave a Reply

Your email address will not be published. Required fields are marked *