jquery - passing credentials not working -


i trying make json call, passing credentials. if user logged system using sql membership, how can pass credentials without getting this:

log in image

here code calls web.api:

note: call being made cross domain: i.e. www.project.com -> api.project.com

var url = 'http://api.project.com/lookups/uploadtypes?callback=?';  $.ajax({     type: 'get',     url: url,     async: true,     xhrfields: {         withcredentials: true     },     jsonpcallback: 'handler',     contenttype: "application/javascript",     datatype: 'jsonp',     success: function (json, textstatus, jqxhr) { console.log(jqxhr.responsetext); },     error: function (json, textstatus, jqxhr) { console.log(jqxhr.responsetext); }  }); 

edit:

i still login when authentication disabled. there place window authentication setting?

enter image description here

to prevent popup have change url following.

var url = 'http://username:password@api.project.com/lookups/uploadtypes?callback=?';

replace username - actual username , password actual password.


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -