i have a question
This making me crazy
I write a barcode scanner witch check data from json.
The script works fine but
After the while loop i want to get a error alert message if the getjson request dont match with the scanned barcode.
That means if the code dont get into the if(myshopdata.order.reference==barcode)
But every time i put the error alert alert("Code cannot be found");
in my code, the error message comes long before the getjson message.
I know that getJSON is async. and try the same with ajax call , but its to slow it tested it.
Can anyone help me how i solve this in my Code?
The error message is the only thing is missing in my script
This is my script