So I copied and pasted the bare bones start code and I get this error message:
TypeError: _qz.tools.hash is not a function
I do not know what is going wrong, I have all the required js files connected, etc.
I have a script block at the bottom of the page to initialize things:
<script type="text/javascript">
qz.security.setCertificatePromise(function(resolve, reject) {
//Preferred method - from server
//$.ajax("assets/signing/public-key.txt").then(resolve, reject);
//$.ajax("assets/signing/www.example.com.cert.pem").then(resolve, reject);
//Alternate method 1 - anonymous
resolve();
});
qz.security.setSignaturePromise(function(toSign) {
return function(resolve, reject) {
//Preferred method - from server
// $.ajax("/secure/url/for/sign-message?request=" + toSign).then(resolve, reject);
//$.ajax("../js/qztray/assets/signing/sign-message.php?request=" + toSign).then(resolve, reject);
//Alternate method - unsigned
resolve();
}
});
</script>
And then in my $j(document).ready() I have:
qz.websocket.connect().then(function() {
alert("Connected!");
return qz.printers.find("zebra")
}).then(function(){ alert('next')});
And that is it. I get the connected alert but then I get the error listed above.
TypeError: _qz.tools.hash is not a function
--
You received this message because you are subscribed to the Google Groups "qz-print" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qz-print+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<script type="text/javascript" src="../js/qztray/qz-tray.js"></script>
<script type="text/javascript" src="../js/qztray/dependencies/rsvp-3.1.0.min.js"></script>
<script type="text/javascript" src="../js/qztray/dependencies/sha-256.min.js"></script>
And I even added an alert(); into the sha-256 just to make sure it loaded, and it popped up the alert.
Thanks
PS - Dyslexia can make coding slow sometimes.
Please see below,
head>
<meta charset="UTF-8">
<script type="text/javascript" src="scripts/qzTray/js/dependencies/rsvp-3.1.0.min.js"></script>
<script type="text/javascript" src="scripts/qzTray/js/dependencies/sha-256.min.js"></script>
<script type="text/javascript" src="scripts/qzTray/js/qz-tray.js"></script>
<script>
qz.security.setCertificatePromise(function(resolve, reject) {
resolve();
});
qz.security.setSignaturePromise(function(toSign) {
return function(resolve, reject) {
resolve();
}
});
function setInitState(){
qz.websocket.connect().then(function() {
return qz.printers.find('zebra')
}).then(function(printer) {
var config = qz.configs.create(printer);
var airbills = document.getElementById('airbills').value;
var imageData = document.getElementById('imageData' + airbills).value;
var data = [{
type: 'raw',
format: 'base64',
data: imageData
}];
return qz.print(config, data);
}).catch(function(e) {
//console.error(e);
alert(e);
});
}
</script>
</head>
is there anything wrong in my code?
Thanks a lot,
TypeError: _qz.tools.hash is not a function. (In '_qz.tools.hash(_qz.tools.stringify(signObj))', '_qz.tools.hash' is null)
Thanks again
--
You received this message because you are subscribed to the Google Groups "qz-print" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qz-print+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to qz-print+unsubscribe@googlegroups.com.