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

<!DOCTYPE html>

  var wgCanonicalNamespace = 'Log'; alert ("type = "+wgCanonicalNamespace); $(document).ready( function {			if ( wgCanonicalNamespace == 'Log' ) { //to be updated with more namespaces				var filtered = $('#WikiaPageHeader h1').text.replace(/.+:/,"");				alert(filtered);				$('#WikiaPageHeader h1').replaceWith(' '+filtered+' ');			}		});

Something:Foo Bar


 * 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)