ByteScout Cloud API Server - Barcode Generator API - JavaScript - Generate Barcode (JQuery) - Async API - ByteScout

ByteScout Cloud API Server – Barcode Generator API – JavaScript – Generate Barcode (JQuery) – Async API

  • Home
  • /
  • Articles
  • /
  • ByteScout Cloud API Server – Barcode Generator API – JavaScript – Generate Barcode (JQuery) – Async API

How to generate barcode (jquery) async API for barcode generator API in JavaScript and ByteScout Cloud API Server

What is ByteScout Cloud API Server? It is API server that is ready to use and can be installed and deployed in less than 30 minutes on your own Windows server or server in a cloud. It can save data and files on your local server-based file storage or in Amazon AWS S3 storage. Data is processed solely on the API server and is powered by ByteScout engine, no cloud services or Internet connection is required for data processing..

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

generate_barcode.js

      
// Please NOTE: In this sample we're assuming Cloud Api Server is hosted at "https://localhost". // If it's not then please replace this with with your hosting url. $(document).ready(function () { $("#resultBlock").hide(); $("#errorBlock").hide(); }); $(document).on("click", "#submit", function () { var url = "https://localhost/barcode/generate?name=barcode.png"; url += "&type=" + $("#barcodeType").val(); // Set barcode type (symbology) url += "&value=" + $("#inputValue").val(); // Set barcode value url += "&async=True"; // Set async // Show loader $("#loader").show(); $.ajax({ url: url, type: "GET" }) .done(function (data, textStatus, jqXHR) { if (data.error) { $("#errorBlock").show(); $("#error").html(data.message); $("#loader").hide(); } else { checkIfJobIsCompleted(data.jobId, data.url); } }) .fail(function (jqXHR, textStatus, errorThrown) { $("#errorBlock").show(); $("#error").html("Request failed. Please check you use the correct API key."); $("#loader").hide(); }); }); function checkIfJobIsCompleted(jobId, resultFileUrl) { $.ajax({ url: 'https://localhost/job/check?jobid=' + jobId, type: 'GET', success: function (jobResult) { $("#status").html(jobResult.status + ' &nbsp;&nbsp;&nbsp; <img src="ajax-loader.gif" />'); if (jobResult.status == "working") { // Check again after 3 seconds setTimeout(function(){ checkIfJobIsCompleted(jobId, resultFileUrl); }, 3000); } else if (jobResult.status == "success") { $("#resultBlock").show(); $("#image").attr("src", resultFileUrl); } $("#loader").hide(); }, error: function(){ $("#errorBlock").show(); $("#error").html("Request failed. Please check you use the correct API key."); $("#loader").hide(); } }); }

VIDEO

ON-PREMISE OFFLINE SDK

Get 60 Day Free Trial

See also:

ON-DEMAND REST WEB API

Get Your API Key

See also:

Tutorials:

prev
next