Wiki143:WikiProject User scripts/Scripts/Get Page Name

From Wikipedia, the free encyclopedia
Revision as of 08:25, 5 April 2018 by imported>TheDJ
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
/*<pre>*/
/*Returns the name of the page. For example, if you were browsing the "[[foo]]" WP page, getPname() would return "foo".*/
function getPname() {
  return mw.config.get('wgPageName').replace(/_/g, ' ');
}
/*</pre>[[Category:Wikipedia scripts]]*/