Difference between revisions of "Sandbox"

From Organic Design wiki
m
 
(48 intermediate revisions by the same user not shown)
Line 1: Line 1:
<html>
+
{{video|odysee|ukraine-crisis-what-you-re-not-being/9af844f8248198fa22ae472d7002423e3389a3ec|300|right}}
<input id="param1" value="JavaScript" />
 
<input type="button" id="send-email" value="Send" />
 
<script type="text/javascript">
 
// <![CDATA[
 
$('#send-email').click(function() {
 
  var param1 = $('#param1').val();
 
  var ask = '{{#ask:[[Category:' + param1 + ']]|link=none|sep=;|limit=500}}';
 
  console.log('Sending query: ' + ask);
 
var title = mw.config.get('wgPageName');
 
console.log(title);
 
  $.ajax({
 
    type: 'post',
 
    url: mw.util.wikiScript('api'),
 
    dataType: 'json',
 
    data: {
 
      action: 'parse',
 
      text: ask,
 
      contentmodel: 'wikitext',
 
      format: 'json'
 
    },
 
    success: function(json) {
 
    var page = mw.config.get('wgPageName');
 
    window.location = mw.util.wikiScript() + '?title=Special:EmailPage&ea-title=' + page + '&ea-to=' + json.parse.text;
 
    }
 
  });
 
});
 
// ]]>
 
</script>
 
</html>
 

Latest revision as of 13:50, 17 February 2023