<head>
<meta charset="utf-8">
</head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="/tesseract/tesseract.js"></script>
<div id="ocr_result"></div>
<script>
var params = window
.location
.search
.replace('?','')
.split('&')
.reduce(
function(p,e){
var a = e.split('=');
p[ decodeURIComponent(a[0])] = decodeURIComponent(a[1]);
return p;
},
{}
);
console.log('Path:', params['data']);
document.getElementById("ocr_result").innerHTML = "0";
Tesseract.recognize(params['data']).then(function(result) {lang: "rus"}).then(function(result) {
document.getElementById("ocr_result").innerHTML = result.text;
console.log('Result:', result.text);
$.post("ajax.php", { name: result.text} );
});
</script>