Log in

View Full Version : Resolved JavaScript code (SymError, etc) added to page when uplaoding to server



Snookerman
02-13-2009, 01:46 PM
Hey

Every time I load a page to a server and then view the source code, there is some JavaScript code that I didn't write myself, it was just added.

I have always had this and it didn't bother me since I thought it was normal, but I noticed that many pages don't have it, so there must be something with mine.

There is a piece of code added to the head section and one after the html closing tag. They look like this:

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

function SymError()
{
return true;
}

window.onerror = SymError;

function SymInitWinOpen()
{
if (SymRealWinOpen == null)
SymRealWinOpen = window.open;
return SymWinOpen;
}

function SymWinOpen(url, name, attributes)
{
return (new Object());
}

var SymRealWinOpen;
window.open = SymInitWinOpen();

//-->
</script>


<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>

Id doesn't seem to appear when I validate the code but it's there if I view the source or save the page.

What I'd like to know is: What is it? Why does it appear? What does it do? Do I need it? If no, how do I get rid of it?

Thanks for your help!

bluewalrus
02-13-2009, 02:10 PM
Yahoo servers write some script to pages. Do you have your own server or are you using one? In a yahoo page I worked on the code didn't show up when I edited just when I hit view source on the live page. It did say it came from the server but maybe you have a different one that doesnt?


</html><!-- text below generated by server. PLEASE REMOVE --><!-- Counter/Statistics data collection code --><script language="JavaScript" src="http://us.js2.yimg.com/us.js.yimg.com/lib/smb/js/hosting/cp/js_source/whv2_001.js"></script><script language="javascript">geovisit();</script><noscript><img src="http://visit.webhosting.yahoo.com/visit.gif?us1234534188" alt="setstats" border="0" width="1" height="1"></noscript>

Snookerman
02-13-2009, 02:32 PM
I've seen this on pretty much all the pages I've written so far. I've used mostly web servers (one.com, 110mb.com, etc) and also local servers (municipality server). It happens when I upload with IE's ftp, with most popular FTP:s and with 110mb:s file manager. From what I've seen so far, it's not dependent on the server or the ftp service so I'm guessing it's my computer. I run XP sp3 and I have Norton 360:s firewall.

Oh, by the way, I see this code when I view DD:s or Google's source code as well.

Twey
02-13-2009, 03:07 PM
You're running Norton Internet Security. Norton likes to insert such things into downloaded pages.

Snookerman
02-13-2009, 03:16 PM
You're right, it's Norton:
http://service1.symantec.com/SUPPORT/nip.nsf/0/f497e345525fa9e488256dbf007118ac?OpenDocument (http://service1.symantec.com/SUPPORT/nip.nsf/0/f497e345525fa9e488256dbf007118ac?OpenDocument)

Apparently, it's needed for the ad blocking and can be avoided by turning off the ad blocker. They don't really say what it does, though, or if there's a way to get rid of it without turning off the ad blocker.

I think I'll just ignore it, I prefer getting rid of ads.