Callback URL
It is possible to start the scanner from a HTML page in Chrome browser, and get the result back in the same page/tab.
Syntax:
mochalpr://CALLBACKHASH/?url
Example:
mochalpr://CALLBACKHASH/?http://mochasoft.com/plate4.htm
A simple HTML plate4.htm page
Source for plate4.htm:<head> <script type="text/javascript"> function startscan() { platefieldresult.value =""; window.location = "mochalpr://CALLBACKHASH/?"+window.location; } function load_from_url_callback() { var str1= window.location.hash.substring(1); if (str1) { var str2 = platefieldresult.value var n = str1.localeCompare(str2); if (n != 0) { // new plate value is ready to be processed var y = str1.split("?MTIMEX"); platefieldresult.value = y[0]; } } } var x = setInterval(function() { load_from_url_callback() },1000); </script> </head> <body> <h3>license plate test page with callback , using callback to same page</h3> <input onclick="startscan()" type="button" value="Start mocha lpr scanner app" /> <<br> <br> <h3>Result:</h3> <input id="platefieldresult" /><br /> </body> </html>
Copyright (c) 1997-2024 MochaSoft Aps. All Rights Reserved. |