# Javascript: Barcode.getBarcodeType Method

> Gets the type of barcode that is rendered.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > Javascript: Barcode.getBarcodeType Method
- **380 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/barcode/getbarcodetype-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/barcode/getbarcodetype-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/barcode/getbarcodetype-method/llms-full.txt

---

### Description

Gets the type of barcode that is rendered.

### Syntax

```javascript
<void> Barcode.getBarcodeType(<RequestBarcodeTypeCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives the color string as a CSS color string. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `Barcode.getBarcodeType` in a practical document-editing workflow. It gets the type of barcode that is rendered.

```javascript
function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

function inspectBarcodeType(barcode) {
    barcode.getBarcodeType(
        function(barcodeType) {
            if (!barcodeType) {
                console.warn("No barcode type was returned.");
                return;
            }
            
            console.log("get barcode type result:", barcodeType);
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: Barcode.getBackColor Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/barcode/getbackcolor-method/llms-full.txt)
- **Next:** [Javascript: Barcode.getForeColor Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/barcode/getforecolor-method/llms-full.txt)
