New wiki-page
Jump to navigation Jump to search
No edit summary
No edit summary
Line 9: Line 9:
             if(( data.property == message )){
             if(( data.property == message )){
               var text=data.dataitem[0].item.split('_').join(' '); // get rid of _
               var text=data.dataitem[0].item.split('_').join(' '); // get rid of _
                 document.write(message + '<br>');  
                 document.write(text + '<br>');  
             }
             }
       });
       });

Revision as of 08:24, 14 August 2017

<script type="text/javascript">


var message = ; //We should have a message //Thats all the user input

$.getJSON("http://w.ikabodo.se/api.php?action=browsebysubject&subject=Cymric_Male_Names&format=json", function(data) {

     $(data.query.data).each(function(key, data){
           if(( data.property == message )){
              var text=data.dataitem[0].item.split('_').join(' '); // get rid of _
               document.write(text + '
'); } });

});

</script>