Reputation: 2797
I'm sending cross-domain ajax request and on another end request.is_ajax()
gives False
var text = getSelectedText();
text = 'text';
if (text){
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
console.log(this.responseText)
}
};
xhttp.open("GET", "http://example.com/text=" + encodeURIComponent(text), true);
xhttp.send();}
Upvotes: 2
Views: 802