I am currently doing my diploma work on a SharePoint platform, an instrument I have never used before. The users asked me for a method to compare two text fields RTF, to do it create my own text editor in an iframe and use the DiffMatchPatch library, now the problem is in the implementation, you would have to fill the iframe with the value of the column RTF that contains the information that has to be compared.
searching the internet I found different solutions, but none worked, The last piece of code that I use is the following:
<script>
$SP().list("1").get({
fields: "id,corpo",
where: 'id = "1"'
},
function getData(data){
console.log(data + " data");
for (var i = 0; i < data.length; i++){
var frame = document.getElementById("theWYSIWYG");
frame.contentWindow.document.body.innerText = data[i].getAttribute("corpo");
console.log(data[i].getAttribute("corpo"));
}
});
</script>
use the content editor to insert my html code, now, how do I take in some way (if possible) the desired field of the current element?