Similar Question:
How can I create an ajax call without using jQuery?
I currently have JavaScript code utilizing Ajax, but I am looking to achieve the same functionality without using XMLHttpRequest.
$.ajax({
type:'POST',
data:'slug='+prize,
url:'/wybrana-nagroda/',
success:function(msg)
{
$('#whaiting').hide();
if(msg==='winner')
$(window.location).attr('href','/formularz');
}
});
What would be the alternative approach?
function send(post, url) {
var client = new XMLHttpRequest();
client.open("POST", url);
client.send(message);
}
Any suggestions on how to accomplish this?
Thank you!