javascript - Mediawiki API which doesn't match title -
if want article, match page query (e.g. if it's "dog"), there's no problem, however, if doesn't match (e.g. "red dog"), see: "red dog or red dog may refer to:" , nothing after sentence. there's no article references. i'm not sure where's problem, or how fix it.
$.ajax({ url: urls, data: { format: "json", action: "parse", page: match[1], prop:"text", section:0, }, datatype: 'jsonp', headers: { 'api-user-agent': 'example/1.1 (https://www.example.tech/; admin@example.tech) basedonunisoftdevscipt/1.0' }, success: function (data) { console.log(data) var markup = data.parse.text["*"]; var = $('<div></div>').html(markup); i.find('a').each(function() { $(this).replacewith($(this).html()); }); i.find('sup').remove(); i.find('.mw-ext-cite-error').remove(); var rplo ='<p>~ chatbot wrote: <q id="writeajaxed"></q></p>'; $('#context').html(youwrote + message + '</q></p>' + rplo); $('#writeajaxed').html($(i).find('p')); } });
thnx
Comments
Post a Comment