MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
m
testing something
(try and remove white space on firefox using javascript.)
 
m (testing something)
Line 3: Line 3:
// Remove whitespace tags using JS. The CSS-based approach seems to work fine on Chromium-based browsers, but not very well on Firefox.
// Remove whitespace tags using JS. The CSS-based approach seems to work fine on Chromium-based browsers, but not very well on Firefox.
window.onload = function() {
window.onload = function() {
  console.log("tttt");
   var paras = document.querySelectorAll(".mw-parser-output p");
   var paras = document.querySelectorAll(".mw-parser-output p");
  console.log(paras);
   for (var i = 0; i < paras.length; i++) {
   for (var i = 0; i < paras.length; i++) {
     if (paras[i].childNodes.length === 1 && paras[i].childNodes[0].nodeName === "BR") {
     if (paras[i].childNodes.length === 1 && paras[i].childNodes[0].nodeName === "BR") {

Navigation menu