User:Atundo/prova.js

mw.hook( 've.activationComplete' ).add( function {	ve.init.target.serialize( ve.init.target.getSurface.getDom, function (wikitext) { console.warn("###WIKITEXT###"); console.log(wikitext); });	var DOMObj = ve.init.target.getSurface.getDom;	console.warn("###outerHTML###");	console.log(DOMObj.body.outerHTML);	console.warn("###outerTEXT###");	console.log(DOMObj.body.outerText);	/*var service_url = 'https://babelfy.io/v1/disambiguate';	var text = "boh";   var lang = 'EN'    var key = 'f36e3d72-f770-4398-b861-bd5ea7ca7d53'

var params = { 'text'  : text, 'lang' : lang, 'key' : key };

$.getJSON(service_url + "?", params, function(response) {

$.each(response, function(key, val) {

// retrieving token fragment var tokenFragment = val['tokenFragment']; var tfStart = tokenFragment['start']; var tfEnd = tokenFragment['end'];

var tfragment = "Start token fragment: " + tfStart + " " + "End token fragment: " + tfEnd; console.warn(tfragment); //$(' ', {html:tfragment}).appendTo(document.body);

// retrieving char fragment var charFragment = val['charFragment']; var cfStart = charFragment['start']; var cfEnd = charFragment['end'];

var cfragment = "Start char fragment: " + cfStart + " " + "End char fragment: " + cfEnd; console.warn(cfragment); //$(' ', {html:cfragment}).appendTo(document.body);

// retrieving BabelSynset ID           var synsetId = val['babelSynsetID']; var id = "BabelNet Synset id: " + synsetId; console.warn(id); //$(' ', {html:id}).appendTo(document.body);

});

});*/ } );