Site Notice

hello, world

Difference between revisions of "MediaWiki:Js-doc.js"

From Project-EPB Commons
(机智的小鱼君 changed the content model of the page MediaWiki:Js-doc.js from "wikitext" to "JavaScript")
Tag: content model change
Line 9: Line 9:
 
/* Window load finished */
 
/* Window load finished */
 
window.addEventListener("load", function(event) {
 
window.addEventListener("load", function(event) {
   // Do something...
+
   // Variables
 +
  var pageTile,
 +
      pageName,
 +
      backTo;
 +
 
 +
  pageTitle = $('body').attr('data-title');
 +
  pageName = $('body').attr('data-pagename');
 +
  backTo = $('body').attr('data-backto');
 +
 
 +
  if (pageTitle =='Mainpage' || pageTitle =='' || pageTitle == undefined) {
 +
    pageTitle = 'Documentations Center';
 +
  } else if (pageTitle == '404') {
 +
    pageTitle = '404 - Page not found'
 +
  }
 +
 
 +
  $('title').html(pageTitle);
  
 
});
 
});

Revision as of 07:27, 5 September 2019

/**
 *『Wjghj Project Static』
 * This _JavaScript_ code is from https://common.wjghj.cn
 * CC BY-NC-SA
 **/

/* Invoke jQuery */
document.write('<script src="https://common.wjghj.cn/js/jquery"></script>);
/* Window load finished */
window.addEventListener("load", function(event) {
  // Variables
  var pageTile,
      pageName,
      backTo;

  pageTitle = $('body').attr('data-title');
  pageName = $('body').attr('data-pagename');
  backTo = $('body').attr('data-backto');

  if (pageTitle =='Mainpage' || pageTitle =='' || pageTitle == undefined) {
    pageTitle = 'Documentations Center';
  } else if (pageTitle == '404') {
    pageTitle = '404 - Page not found'
  }

  $('title').html(pageTitle);

});