nini9140 / jzebra

Automatically exported from code.google.com/p/jzebra
0 stars 0 forks source link

Print request send to printer if i send dynamic value to function. #80

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
function print64(val) {
 var applet = document.jZebra;
 if (applet != null) {
 // Use jZebra's `"append64"` function. This will automatically convert provided
 // base64 encoded text into ascii/bytes, etc.
 applet.append64(val);
 // Send characters/raw commands to printer
 applet.print();
}
monitorPrinting();
}

If i pass value from onclick like onclick="print64("<?php echo $val; ?>");" , 
this is not send request to print else if i put this value in function like 
applet.append64("<?php echo $val; ?>"); so this is working .

I want in this format (onclick="print64("<?php echo $val; ?>");") because i 
have multiple request .

How i solved this issue ?

Original issue reported on code.google.com by sa...@socialhubris.com on 1 Aug 2012 at 6:37

GoogleCodeExporter commented 9 years ago
I would suggest using appendFile, and put the URL to a php file that echoes 
those commands to the screen and dies.

Alternatively you can try JSON.encode in php and JSON.decode in JavaScript for 
exchanging large amounts of data.  

-Tres

Original comment by tres.fin...@gmail.com on 2 Aug 2012 at 5:25

GoogleCodeExporter commented 9 years ago
This issue is getting closed with status of "invalid".  If there is a specific 
feature request needed for this functionality, please reopen and explain here.  

I would recommend 
"onclick=appendFile('mysite/raw.php?param1=something¶m2=something¶m3=something
');

raw.php:

echo "my raw print code" . $param1;
die;

-Tres

Original comment by tres.fin...@gmail.com on 22 Aug 2012 at 5:33