Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //gets table
- var oTable = document.getElementById('tablename');
- //gets rows of table
- var rowLength = oTable.rows.length;
- //loops through rows
- for (i = 0; i < rowLength; i++){
- //gets cells of current row
- var oCells = oTable.rows.item(i).cells;
- //gets amount of cells of current row
- var cellLength = oCells.length;
- //loops through each cell in current row
- for(var j = 0; j < cellLength; j++){
- // get your cell info here
- var cellVal = oCells.item(j).innerHTML;
- console.log(cellVal);
- var serverRelativeUrlOfMyFile = "https://Sharepointsite/Blacklist.txt";
- $.ajax({
- url: serverRelativeUrlOfMyFile,
- type: "GET"
- }).done(handler);
- function handler(data){
- //console.log(data);
- var lines = data.split('n');
- for(var line = 0; line < lines.length; line++)
- {
- if (cellVal.includes(lines[line])){
- oCells.item[j].style.background = "red";
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment