i need to send an xhr request in PUT method
this is my code :
function put(_url, _callback,_data){
var xhr = createCORSRequest('PUT',_url);
if (!xhr){
throw new Error('CORS not supported');
}
$('.ajax-loading').show();
xhr.send(_data);
/*SUCCESS -- do somenthing with data*/
xhr.onload = function(){
// process the response.
_callback(xhr.responseText);
$('.ajax-loading').hide();
};
xhr.onerror = function(e){
console.log(e);
$('.ajax-loading').show();
};
}
don't know why it doesn't works cause it doesn't pass data to the url i set. while doing same function in POST method is ok!
any ideas?