New wiki-page
No edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
var message = '<!--{$message|escape:'quotes'}-->'; //We should have a message | var message = '<!--{$message|escape:'quotes'}-->'; //We should have a message | ||
//Thats all the user input | //Thats all the user input | ||
Line 11: | 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. | document.write(message + '<br>'); | ||
} | } | ||
}); | }); | ||
}); | }); | ||
</script> | </script> |
Revision as of 08:23, 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(message + '
'); } });
});
</script>