页面源中的自定义JavaScript与粘贴的文件不同

In my Joomla (1.5) installation I'm getting errors presumably because the JS code as it's pasted into the index.php file (above </head>) is somehow changed when I look at the page source.

This is a set of screenshots of what's going on:

You can see my code is saying src="undefined"!==typeof, while the page source is saying src="/undefined"!==typeof.

I tried changing src="/undefined"!==typeof to src=typeof MIX...!=='undefined'?==typeof but it didn't help.

I get this in firebug:

ReferenceError: MIXPANEL_CUSTOM_LIB_URL is not defined

It's my analytics code for MixPanel, & it doesn't report page loads to my dashboard. I don't know how to get it to work.

I think the real issue is with joomla parsing the source index.php and converting that quote to a backslash for some reason. I am not a joomly kind of person, but I offer you these potential hacks to try to fix it quickly:

Try putting parenthesis around the whole expression up until the semicolon.

a.src=("undefined"!==typeof..........);

Another hack... get rid of the ternary operator check for the variable, and always just define a.src using the else part from the original expression:

a.src="file:"===e.location.protocol......;