[Solved] converting XMLHTTPRequest into $ajax

Here’s a jQuery version of the code: $.ajax({ url : ‘https://www.google.co.uk’, //cross-domain? this won’t work username : ‘user’, password : ‘password’, type : ‘GET’, //default is GET, but i put it here to clarify success : function(data){ $(‘#listAttributes’).html(data); } }); For more details and settings, read the jQuery.ajax() documentation 1 solved converting XMLHTTPRequest into $ajax

[Solved] CORS preflight return Access-Control-Allow-Origin but response hangs on

Both the preflight and actual response must grant permission with Access-Control-Allow-Origin. If only the prelight does, then the order of events is: JavaScript asks to make request Browser makes preflight request Server sends preflight response Browser checks CORS (passes) Browser makes actual request Server sends actual response Browser checks CORS (fails) Browser denies permission to … Read more