Can we get the desired part from the vicar api?

I use the wiktionary api to get information from wiktionary.org ..

I get the data in json format and I can parse it too ...

but I want to remove part of the result from the result (in fact, I only need some data), but I do not know how to remove certain content from the result.

The code I use is

<script type="text/javascript" src="./jquery-1.4.3.min.js"></script>
<div id="wikiInfo">&nbsp; contents</div>
<script type="text/javascript">
$.getJSON('http://en.wiktionary.org/w/api.php?action=parse&page=acting&format=json&prop=text&callback=?',
function(json) {
$('#wikiInfo').html(json.parse.text.*);
$("#wikiInfo").find("a:not(.references a)").attr("href", function(){ 
            return "http://sample.com/" + $(this).attr("href");});
$("#wikiInfo").find("a").attr("target", "_blank");  }
);
</script>

the above code displays the data as on the next page.

http://englishore.com/parse-wiki.php

But I need to cancel the "Pronunciation and translation" part of the result.

How can i do this?

+3
source share
2 answers

, . https://gist.github.com/674522, . , lonesomeday, href , .

+2

json.parse.text.* . JS - * array. :

$('#wikiInfo').html(json.parse.text['*']);
+1

Source: https://habr.com/ru/post/1773664/


All Articles