Skip to content

Commit 673d9ce

Browse files
docs: Update index.md to fix wrong code snippets
1 parent 37037f7 commit 673d9ce

File tree

1 file changed

+4
-4
lines changed
  • programming/javascript/user-guide

1 file changed

+4
-4
lines changed

programming/javascript/user-guide/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -397,13 +397,13 @@ cvRouter.setInput(cameraEnhancer);
397397
398398
### Step 4: Register a result receiver
399399
400-
Once the image processing is complete, the results are sent to all the registered `CapturedResultReceiver` objects. Each `CapturedResultReceiver` object may encompass one or multiple callback functions associated with various result types. This time we use `onCapturedResultReceived`:
400+
Once the image processing is complete, the results are sent to all the registered `CapturedResultReceiver` objects. Each `CapturedResultReceiver` object may encompass one or multiple callback functions associated with various result types. This time we use `onDecodedBarcodesReceived`:
401401
<!--In our particular case, our focus is on identifying barcodes within the images, so it's sufficient to define the callback function `onDecodedBarcodesReceived`:-->
402402
403403
```javascript
404404
const resultsContainer = document.querySelector("#results");
405405
const resultReceiver = new Dynamsoft.CVR.CapturedResultReceiver();
406-
resultReceiver.onCapturedResultReceived = (result) => {
406+
resultReceiver.onDecodedBarcodesReceived = (result) => {
407407
if (result.barcodeResultItems?.length) {
408408
resultsContainer.textContent = '';
409409
for (let item of result.barcodeResultItems) {
@@ -419,7 +419,7 @@ You can also write code like this. It is the same.
419419
420420
```javascript
421421
const resultsContainer = document.querySelector("#results");
422-
cvRouter.addResultReceiver({ onCapturedResultReceived: (result) => {
422+
cvRouter.addResultReceiver({ onDecodedBarcodesReceived: (result) => {
423423
if (result.barcodeResultItems?.length) {
424424
resultsContainer.textContent = '';
425425
for (let item of result.barcodeResultItems) {
@@ -505,7 +505,7 @@ Please be aware that it is necessary to update the `CapturedResultReceiver` obje
505505
506506
```javascript
507507
const EnumCRIT = Dynamsoft.Core.EnumCapturedResultItemType;
508-
resultReceiver.onCapturedResultReceived = (result) => {
508+
resultReceiver.onDecodedBarcodesReceived = (result) => {
509509
if (result.barcodeResultItems?.length) {
510510
// Use a filter to get the image on which barcodes are found.
511511
let image = result.items.filter(

0 commit comments

Comments
 (0)