1
0
Fork 0

Get primary form from API

This commit is contained in:
Alex Kotov 2023-02-18 15:47:55 +04:00
parent 3f5db5230b
commit 8069a3a544
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
4 changed files with 5 additions and 6 deletions

View File

@ -3,6 +3,7 @@ $(function() {
$.getJSON(
'http://ksenia.causa-arcana.com/api/words/' + $(elem).data('id'),
function(data) {
var primary_form = data['primary_form']
var part_of_speech = data['part_of_speech']
var examples = []
@ -10,6 +11,7 @@ $(function() {
examples.push('<li>' + item[0] + ' &mdash; ' + item[1] + '</li>')
})
$('#primary-form').text(primary_form)
$('#part-of-speech').text(part_of_speech)
if (examples.length > 0) {

View File

@ -8,8 +8,7 @@
<body>
<div id="word" data-id="1"></div>
<h1>არის</h1>
<h1 id="primary-form"></h1>
<p id="part-of-speech"></p>
<p>быть</p>

View File

@ -8,8 +8,7 @@
<body>
<div id="word" data-id="2"></div>
<h1>აქვს</h1>
<h1 id="primary-form"></h1>
<p id="part-of-speech"></p>
<p>иметь (неодушевлённое)</p>

View File

@ -8,8 +8,7 @@
<body>
<div id="word" data-id="3"></div>
<h1>ყავს</h1>
<h1 id="primary-form"></h1>
<p id="part-of-speech"></p>
<p>иметь (одушевлённое)</p>