Forum:Pagenamefunction inside href

I try to add an pagename function inside this js switch function. But I can't find how to add this function in js. This what I got for the moment. I currently use $wgPageName. But it need something to see it as function and not as url.

--Jens Ingels (talk) 15:59, August 4, 2012 (UTC)