User:Xenwolf/vector.js: Difference between revisions

From Xenharmonic Wiki
Jump to navigation Jump to search
Xenwolf (talk | contribs)
m ... testing done.
Xenwolf (talk | contribs)
m testing...
Line 1: Line 1:
function format_words(title, numWords){
  let text = title+" ("+numWords+" words)";
  return text;
}
$(document).ready(function(){
$(document).ready(function(){
   var numWords = $("#mw-content-text > div").text().split(" ").length;
   var numWords = $("#mw-content-text > div").text().split(" ").length;
   var header = $("#firstHeading").text();
   var header = $("#firstHeading").text();
   $("#firstHeading").text(header + " (" + numWords + " words)");
   $("#firstHeading").text(format_words(header, numWords));
});
});

Revision as of 14:25, 30 May 2020

function format_words(title, numWords){
  let text = title+" ("+numWords+" words)";
  return text;
}

$(document).ready(function(){
  var numWords = $("#mw-content-text > div").text().split(" ").length;
  var header = $("#firstHeading").text();
  $("#firstHeading").text(format_words(header, numWords));
});