Board Thread:Support Requests - Getting Technical/@comment-4572079-20140321175520/@comment-2093602-20140321202415

function pageInCategory(cat) { var cleaned = cat.charAt(0).toUpperCase + cat.slice(1).replace(/_/g,' '); return mw.config.get('wgCategories').indexOf(cleaned) != -1; }

Usage: if(pageInCategory('Some Category')) { ... }