Forum:Some help with a two line script

Hey everyone. Recently, we got some extra namespaces in the Dead Space Wiki, one of them being the "Log" namespace.

As a result, the article names (the names of the Logs) in this namespace appear in the form of "Log:Some Name", like this.

I made a small script to filter out anything prior to the : in the article title, so that just the name of the Log appears.

The script is this:

I know it is correct, because it works on the dummy page I made, but it is not working in the wiki.

Any ideas?

By the way, the dummy page is this, just copy paste it in a new .html document and open it in your browser


 * This code appears to be working (tested on Autopsy Report). However, there is a better way to do this. The only drawback is, it's not automated. Using on the page will display that title on the page without requiring JavaScript. The main benefit is: the user's don't see the change when viewing the page. I prefer the non-javascript solution personally because I hate seeing pages shift while they are loading. Rappy 04:24, June 30, 2012 (UTC)


 * Well, I'll be damned. For whatever reason, on Firefox, which I use as my main browser, some Javascript events fail to execute on wikia pages, like the dropdown lists from buttons. Strange, but definitely a problem on my end, will look at it. Everything, including my "problematic" script above works fine on Chrome.
 * Actually, would you or someone else please confirm that this kind of thing only happens to my Firefox browser? Try pressing the down arrow on buttons and see if the list comes up. Or if the script above worked for you on Firefox, that singles me out. (Note: I have cleared the browser's cache, to no avail. This may be like the time the editor failed to initialise on Firefoxn and I had to restore the installation)
 * About what you suggest, do I need to do something more than adding on the top of the page's content? Because I did just that, and I did not see a difference; the "Log:" prefix was still there for that split second until the script took it out. -- Noemo n  * talk *  05:00, June 30, 2012 (UTC)


 * I don't think the DISPLAYTITLE magic word can be used to omit the namespace from the article title. From mediawiki.org: "The value must be equivalent to the default title: only capitalization changes and replacing spaces with underscores are allowed". Correct me if I'm wrong on that, but that's my interpretation.
 * Couldn't you just do something like this?


 * stores the pagename with the namespace omitted. Matthew2602  Wall 05:30, June 30, 2012 (UTC)


 * Huh, you are absolutely right, I hadn't even noticed this variable. Cheers. -- Noemo n  * talk * 05:36, June 30, 2012 (UTC)
 * Haha, no worries. Matthew2602  Wall 05:45, June 30, 2012 (UTC)

On the topic of, the limitation can be removed on request by staff so that anything can be used as the title. I would highly suggest doing it this was, as it a lot simpler and works for everyone.


 * I may request for it, but again, that'd mean we'd have to manually add it in about 400-500 pages. That'd be rather tiresome. On the other hand the script solution's only drawback is the fact that the original title is visible for a fraction of a second, which one may not even notice.
 * FYI, as for why the script was not working on my Firefox, it was because of a value inside the EasyPrivacy list for AdBlock Plus. The value in question is something along the lines of "wikia-beacon". If anyone else has the same problems, just do a search for this value in the AdBlock interface, and add it to the exceptions. -- Noemo n  * talk * 10:51, June 30, 2012 (UTC)
 * @Mathmagician: you can ask Staff to set the PHP variable  to   so that it is overridden. 11:31, June 30, 2012 (UTC)