Thread:Project:Support desk/How to add a script excerpt to the header of each page to introduce MathJax (without SimpleMathJax extension)

How to add a excerpt to the header of each page to introduce MathJax (without SimpleMathJax extension)

I've tried editing the MediaWiki:Common.js file, adding, as I would add to the header of a normal HTML document. This doesn't work, however, perhaps because the javascript isn't inserted verbatim (as far as I can tell, on inspection of the the source of pages afterwards). I've been going through the php files that seem relevant (OutputPage.php, Html.php, WebStart.php) and attempting to have them directly write this code snippet to the header, but I'm new to PHP and my dogged, misguided attempts garner me little success.

I tried the SimpleMathJax extension initially, but including it in LocalSettings.php only crashed the site (though other extensions I've manually added work correctly).

I'd rather use the MathJax formatting, so would be more grateful for suggestions on how to get MathJax into the header than mend the SimpleMathJax extension. Any help at all is highly appreciated, of course!