10

I'm perusing some source, and I see this

<script type="text/javascript" src="script/jquery/jquery.1.7.1.js">//]]>
</script>
<script type="text/javascript" src="script/swfobject_modified.js">//]]>
</script>

There's a dozen or so dependencies in the head listed in such a fashion, what is the purpose of the //]]> after each script tag?

The code looks a bit old school, and is set to emulate IE7 in compat:

<meta http-equiv="X-UA-Compatible" content="IE=7" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

Just curious really, thanks.

Dropout
  • 13,653
  • 10
  • 56
  • 109
danjah
  • 2,939
  • 2
  • 30
  • 47

1 Answers1

4

My best guess is that the script code was originally put in a CDATA section like this:

<script type="text/javascript"
//<![CDATA[
//]]>
</script>

When deleting //<![CDATA[ (which wasn't needed since it's referring to an external source file), they simply neglected to remove the final //]].

Community
  • 1
  • 1
Rick Hitchcock
  • 35,202
  • 5
  • 48
  • 79
  • 1
    That's what I was thinking, just messy cleanup, but it's after every single JS dependency, 3rd party or proprietary. Let's see if we guessed right or otherwise... – danjah May 05 '15 at 11:39
  • 1
    Alright, I'm calling it, its some poor cleanup - I couldn't find anything pertinent. I had hoped there was some cool trick I never knew about to make files instantly download using magic. Nevermind. – danjah May 07 '15 at 04:49
  • "make files instantly download using magic" - that'd be Pied Piper from Silicon Valley, I guess. – danjah Jun 28 '16 at 05:18