Source Code : test_words.html
<script type="text/javascript">
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Όνομα Ζώο Φυτό - Το παιχνίδι </title>
<script src="tests_pretty.js"></script>
</head>
<body>
Example :
<mark>Services Word Games</mark>
<br/> <br/>
<script>
displayInfo(" api : " + URL, null, 'url');
let sPlugin = "wordAnalyzer";
let gameDBPin = 'EE12954';
let nickname = "dsphinx_OK";
let word = "απόδειξη";
let sLetter = "Α";
serviceCoreData(URL, {
"configuration": [sPlugin, 'analyze'],
'pin': gameDBPin,
'nickname': nickname,
'word': word,
'startingLetter' : sLetter
})
.then(data => {
const responseData = JSON.parse(data);
displayInfo(" Analyze Word ", responseData, 'word1');
});
</script>
</body>
</html>
</script>
Typical Syntax Call
<script type="text/javascript">
let URL = 'https://xxx.xxx.xxx.xxx/service.php'
let sPlugin = "plugin";
//
const data = { "configuration": [sPlugin, "action", "extra"],
'word': ' Απόδειξη ',
};
//
fetch(URL, { method: "POST", body: JSON.stringify(data),
headers: { "Content-type": "application/json;
charset=UTF-8"
}
}).then(response => response.json())
.then(dataRet => {
const returnJSON = JSON.parse(dataRet);
// returnJSON
// ....
///
})
.catch((error) => {
displayInfo(" Error : " + error, data);
});
</script>