User:Xenwolf/vector.js: Difference between revisions
Jump to navigation
Jump to search
m testing... |
m testing... |
||
| Line 1: | Line 1: | ||
function format_words(title, numWords){ | function format_words(title, numWords){ | ||
console.log("format_words [enter]"); | |||
var text = title+" ("+numWords+" words)"; | var text = title+" ("+numWords+" words)"; | ||
console.log("format_words: text:"+text); | |||
return text; | return text; | ||
} | } | ||
$(document).ready(function(){ | $(document).ready(function(){ | ||
console.log("on ready [enter]"); | |||
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(format_words(header, numWords)); | $("#firstHeading").text(format_words(header, numWords)); | ||
console.log("on ready [leave]"); | |||
}); | }); | ||
Revision as of 15:31, 30 May 2020
function format_words(title, numWords){
console.log("format_words [enter]");
var 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]");
});