MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / clickHandler

Function clickHandler

assets/js/minions.js:23–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21
22//for the operation and callback operation
23function clickHandler() {
24var inputText = txtInput.value; // taking input
25
26// calling server for processing
27fetch(getTranslationURL(inputText))
28.then(response => response.json())
29.then(json => {
30 var translatedText = json.contents.translated;
31 outputDiv.innerText = translatedText; // output
32 })
33.catch(errorHandler)
34};
35
36btnTranslate.addEventListener("click", clickHandler)

Callers

nothing calls this directly

Calls 1

getTranslationURLFunction · 0.85

Tested by

no test coverage detected