Wikipedia:WikiProject User scripts/Scripts/Get Page Name

This is the current revision of this page, as edited by TheDJ (talk | contribs) at 08:25, 5 April 2018. The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
/*<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]]*/