let word=$("#word");let axButton=$("#axButton");let axSpinner=$("#axSpinner");var dicWord;var soundSrc;var soundName;var eword;var eflag;var emean;var aemean;var smeaning;var wordcount;var meancount;var au;var pemean;var myArray;var newdat;var newmean;var finalarray;var key;var req=new XMLHttpRequest();req.onload=function exTra(){key=this.responseText};req.open("get","extra.php",!0);req.send();axButton.click(function(){sendReq();word.blur()});function sendReq(){$.ajax({url:"https://dictionaryapi.com/api/v3/references/learners/json/"+word.val()+"?key="+key,type:"GET",dataType:"json",success:(data)=>{if(isDataEmpty(data)){return}else{clearDefinitions();displayDefinitions(data);renderSound(data)}},error:(xhr,status,error)=>{}})} function isDataEmpty(data){if($.isEmptyObject(data)){clearDefinitions();$("#definitionList").after("
උච්චාරණය:
";let subfolder=soundName.charAt(0);soundSrc=`https://media.merriam-webster.com/soundc11/${subfolder}/${soundName}.wav?key=${key}`;au.controls=!0;au.src=soundSrc;li.appendChild(lab);li.appendChild(au);recordingsList.appendChild(li)}} const shareData={title:'kadda.online',text:'ලොව හොඳම ඉංග්රීසි-සිංහල ශබ්දකෝෂය මෙන්න!',url:'https://kadda.online'} const btn=document.getElementById('sharebutton');btn.addEventListener('click',async()=>{try{await navigator.share(shareData)}catch(err){}})