Currently I am using the below code, but either No 'Access-Control-Allow-Origin' header or error 400 comes up everytime. I have looked for guides about No 'Access-Control-Allow-Origin' header, but haven't found any of use. My goal is to just grab the users username so I can use it in combination with an app I have created.
$('#LoginBtn').click(function () {
$.ajax({
url: Url,
data: {
client_id: "App_Key",
response_type: "code",
},
dataType: 'jsonp',
type: 'GET',
success: function(response) {
alert('Success!')
},
error: function(errorThrown) {
alert(errorThrown.error);
}})
});