At the moment i am testing all on localhost but in my live version i am to call a online (http) url.
I have included the latest jQuery
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
Now the main part of my javascript
<script type="text/javascript">
$(document).ready(function () {
$('#theBarcodeA').keyup(function (e) {
barcodeA = $(this);
// if Enter key was pressed, send the barcode to backend
if ((e.keyCode == 13) && (barcodeA.val().length > 2)) {
$('#theBarcodeB').focus();
//clean the message/status
document.querySelector('#status').innerHTML = '';
}
});
$('#theBarcodeB').keyup(function (e) {
barcodeB = $(this);
// if Enter key was pressed, send the barcode to backend
if ((e.keyCode == 13) && (barcodeB.val().length > 2)) {
document.querySelector('#status').innerHTML = barcodeA.val()+' '+barcodeB.val();//just testing
var codeA = barcodeA.val();
var codeB = barcodeB.val();
$.ajax({
type: "POST",
url: "http://localhost/testdomain.com/scannerconnector/connectBars.php",
data: 'barcodeA=' + codeA + '&barcodeB=' + codeB,
success: function (data) {
console.log(data);
console.log(status);
$("#status").html(data);
// document.querySelector('#status').innerHTML = data;
}
});
}
});
});
but i get the " $.ajax is not a function" error message