User:Xenwolf/vector.js: Difference between revisions

From Xenharmonic Wiki
Jump to navigation Jump to search
Xenwolf (talk | contribs)
m testing...
Xenwolf (talk | contribs)
m testing...
Line 1: Line 1:
function format_words(title, numWords){
function format_words(title, numWords){
   console.log("format_words [enter]");
   console.log("format_words [enter]");
   var text = title+" ("+numWords+" words)";
   let text = title+" ("+numWords+" words)";
   console.log("format_words: text:"+text);
   console.log("format_words: text:"+text);
   return text;
   return text;

Revision as of 20:35, 30 May 2020

function format_words(title, numWords){
  console.log("format_words [enter]");
  let text = title+" ("+numWords+" words)";
  console.log("format_words: text:"+text);
  return text;
}

$(document).ready(function(){
  console.log("on ready [enter]");
  var numWords = $("#mw-content-text > div").text().split(" ").length;
  var header = $("#firstHeading").text();
  $("#firstHeading").text(format_words(header, numWords));
  console.log("on ready [leave]");
});