Wikipedia:WikiProject User scripts/Scripts/Get Page Name: Difference between revisions

Content deleted Content added
JesseW (talk | contribs)
m linking source of the code
m problems and solutions
Line 8:
};
}
</nowiki></pre>
 
/* This code may be problematic when it comes to titles with ampersands, etc, which are stored as ''& amp ;'' in HTML (without the spaces).
This code was taken from the [[Wikipedia:WikiProject User scripts/Scripts/Show last diff|Show last diff]] code.
A solution that solves this is the following:
return document.title.substr(0, document.title.lastIndexOf(' - Wikipedia, the free'));
*/
</nowiki></pre>