Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

Simple JavaScript Question


ghost's Avatar
0 0

I know JS is a scripting language but I'm posting in the programming section. Mods feel free to move this post if you need to.

Could someone please explain to me the purpose of the code below. I see it on the majority of web pages and don't understand what it does. Cheers

<script language="JavaScript">
<!--

var SymRealOnLoad;
var SymRealOnUnload;
function SymOnUnload()
{
  window.open = SymWinOpen;
  if(SymRealOnUnload != null)
     SymRealOnUnload();
}

function SymOnLoad()
{
  if(SymRealOnLoad != null)
     SymRealOnLoad();
  window.open = SymRealWinOpen;
  if (SymRealOnUnload == null)
  {
     SymRealOnUnload = window.onunload;
     window.onunload = SymOnUnload;
  }
}

function SymInitWinOnload()
{
  if ( SymRealOnLoad == null )
     SymRealOnLoad = window.onload;
   return SymOnLoad;
}

window.onload = SymInitWinOnload();

//-->
</script>

ghost's Avatar
0 0

it all looks rather pointless and redundant to me lol. What site was it in, this site?


ghost's Avatar
0 0

Didn't find it on HBH but a similar JS script seems to be on HBH too.


ghost's Avatar
0 0

at first I thought it might have something to do with ads, but I think it actually has something to do with symantic's norton antivirus, adding it on for your own protection or something, it helps to stop malicious scripts or something.

there's more info on it here: http://www.webmasterworld.com/forum91/1906.htm


ghost's Avatar
0 0

I think that's on most pages that use JavaScript.

With JavaScript, it only shows the content in "body" when the page has loaded, and that's what that code is showing.. That's my guess :p