Is it possible to send an IPP Print request from the browser using ajax?
I assume it would look something like this:
// Data to be sent
var data = "Testing\nTesting\n1\n2\n3";
// Jquery AJAX call
$.ajax("ipp://<printerip>:631", {
'type': 'POST',
'data': data,
'complete': function(jqXHR, textStatus){
alert('Result:'+textStatus)
}
});
The only problem is I get:
XMLHttpRequest cannot load ipp://<printerip>:631.
Cross origin requests are only supported for HTTP.
Is there anyway to get around this? Or is this simply impossible?
There's a pure JavaScript IPP implementation available at https://www.npmjs.com/package/ipp (not sure if it runs in browsers)
Answer: It's not possible to send an IPP request using ajax.