Skip to content

Commit 6fd2144

Browse files
committed
Fix language issue in javascript
1 parent 21a8f38 commit 6fd2144

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

articles/cognitive-services/Computer-vision/QuickStarts/javascript-read-text-v3.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,18 @@ To create and run the sample, do the following steps:
6464
var sourceImageUrl = document.getElementById("inputImage").value;
6565
document.querySelector("#sourceImage").src = sourceImageUrl;
6666
67+
const params = {
68+
language: language,
69+
};
70+
71+
const searchParams = new URLSearchParams(params);
72+
6773
// This operation requires two REST API calls. One to submit the image
6874
// for processing, the other to retrieve the text found in the image.
6975
//
7076
// Make the first REST API call to submit the image for processing.
7177
$.ajax({
72-
url: uriBase,
78+
url: uriBase + "?" + searchParams.toString(),
7379
7480
// Request headers.
7581
beforeSend: function(jqXHR){
@@ -80,7 +86,7 @@ To create and run the sample, do the following steps:
8086
type: "POST",
8187
8288
// Request body.
83-
data: JSON.stringify({url: sourceImageUrl, language: language}),
89+
data: JSON.stringify({url: sourceImageUrl}),
8490
})
8591
8692
.done(function(data, textStatus, jqXHR) {

0 commit comments

Comments
 (0)