php - esponse to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin'
hi i am using jquery ajax method to get accces to login token but getting this message
Failed to load https://login.salesforce.com/services/Soap/u/42.0?wsdl: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://www.example.com
$(document).ready(function(){
//alert('blnk');
$.ajax({
headers: {
"Accept" :'application/json' //If your header name has spaces or any other char not appropriate
},
url: 'https://login.salesforce.com/services/Soap/u/42.0?wsdl',
contentType: "application/json; charset=utf-8",
type: 'post',dataType: "post",data:JSON.stringify( {username :'demo', password :'demo'}),
crossDomain: true,
success: function(resuklt){
console.log(resuklt);
}});
[enter image description here][1]
});
Answer
Solution:
Please use ...
before succes function..