Zebra Javascript printing status from printer

Hello guys!

 

Using the web developing guide that Robin provided (link incoming..), I am trying to make an application so I can print some labels with user input. For now it is working fine, but if I wanna share this application with other people, so I would like there to be a button in my application so people can test their printer, because I can already predict that a lot of people are going to fill in a wrong IP or someting like that.

 

What I would like their to be is a command so I can get get a response from the printer, and thus check if the printer is connected, it is online etc. Is there any ZPL command or other way to do this?

 

My code:

 

        var ip_addr = "192.168.254.111"

        var url = "http://" + ip_addr + "/pstprnt";

        var async = true;

        var method = "POST";

        var zpl = "^XA^FO20,10^AD^FDTest^FS^FO20,60^B3^FDAAA001^FS^XZ";

        var request = new XMLHttpRequest();

 

        request.onload = function () {

            var status = request.status;

            var data = request.responseText;

        }

 

        request.open(method, url, async);

        request.send(zpl);

 

This works fine, and I can print labels, but I do not receive any response in the status en data variable, so in my application I can never confirm if the label has been  printed.

 

Thanks!