Click here to Skip to main content
15,949,741 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

Am unable to resolving this issue please provide me any solution to fix this.

am getting an below error 

Refused to execute script from ‘https://s2020293361.t.eloqu’ because its MIME type (‘text/html’) is 

Thanks

Bharath


What I have tried:

i tried with all the links below mentioned but am not able to finding the right solution

links:
Chrome refuses to execute an AJAX script due to wrong MIME type
Disable Chrome strict MIME type checking
Refused to execute script, strict MIME type checking is enabled?
Link and execute external JavaScript file hosted on GitHub

$.ajax({
url: 'https://example.com',
type: 'post',
dataType: "jsonp",
contentType: "application/javascript",
success: function (msg) {
console.log("success");
},
error: function (request, status, error) {
console.log(error);
}
});

i tried with diff contentTypes like "text/html","text/javascript","application/jsonp"

and removed from webconfig below line

<pre><remove name="X-Content-Type-Options" />
<add name="X-Content-Type-Options" value="nosniff" />


added http response headers in iis X-Content-Type-Options

still getting same error please suggest me to fix this



Thanks

Bharath
Posted
Updated 21-Mar-18 10:25am

1 solution

The script you're trying to load is being served with a MIME type of text/html. For security reasons, most browsers won't execute that script, because the server is indicating that it's not script.

Start by opening the URL of the script you're trying to execute, and make sure that the content is actually Javascript.

If it is, then you need to contact the owner of the site you're trying to load it from, to get them to correct the headers.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900