Debt Consolidation - Credit Reports - Anime - WoW Gold - Property in Panama

PDA

View Full Version : Can anybody tell me what does this script do?


natalie1981
Oct 18th 2008, 7:52 pm
I've been studying the backlinks over at engadget.com and when I tried to look at their internal linking structure, I've come upon this script, it contains a link to one of their internal pages which shows up as a backlink in Google. So I was just wondering what does this script do exactly and why is it showing up as a backlink when it has no "href" html code? I'm particularly interested in the document.write('<scr' + 'ipt src since that's what's showing up as a backlink.

<script type="text/javascript">
<!--
var actAppName = navigator.appName;
var actAppVersion = navigator.appVersion;
var actAgent = navigator.userAgent;
var actExplorer = actAgent.indexOf('MSIE');
var actNetscape = actAgent.indexOf('Netscape');
var actMozilla = actAgent.indexOf('Mozilla');
var actGecko = actAgent.indexOf('Gecko');
var actFirefox = actAgent.indexOf('Firefox');
var actOpera = actAgent.indexOf('Opera');
var actVer = 'Other';
if ((actMozilla != -1) && (actGecko != -1)) {
actVer = 'Mozilla';
}
if (actNetscape != -1) {
actVer = 'Netscape';
}
if (actExplorer != -1) {
actVer = 'Explorer';
}
if (actFirefox != -1) {
actVer = 'Firefox';
}
if (actOpera != -1) {
actVer = 'Opera';
}
var actMac = actAgent.indexOf('Mac');
var actLinux = actAgent.indexOf('Linux');
var actWindows = actAgent.indexOf('Windows');
var actOS = 'Other';
if (actMac != -1) {
actOS = 'Mac OS';
}
if (actLinux != -1) {
actOS = 'Linux';
}
if (actWindows != -1) {
actOS = 'Windows';
}
var actDate = new Date();
var actTimeZone = actDate.getTimezoneOffset() / -60;
var actLanguage = '';
if ((actNetscape != -1) || (actGecko != -1) || (actOpera != -1)) {
actLanguage = navigator.language;
}
if ((actExplorer != -1) && (actOpera == -1)) {
actLanguage = navigator.userLanguage;
}
document.write('<scr' + 'ipt src="http://www.engadget.com/traffic/?t=js&bv=' + actVer +'&os=' + actOS + '&tz=' + actTimeZone + '&lg=' + actLanguage + '&rv=www.google.com.ph%2Fsearch%3Fsourceid%3Dnavclient-ff%26ie%3DUTF-8%26q%3Dlink%253Ahttp%253A%252F%252Fwww.engadget.com%252F2008%252F08%252F21%252Fdebunk-blackberry-bolds-browser-on-wifi-actually-not-that-slow%252F&rsv=www.google.com.ph&pw=%2F2007%2F07%2F17%2Fwifi-equipped-blackberry-8820-about-to-hit-the-streets%2F&cb=1160114897" type="text/javascript"></scr' + 'ipt>');
// -->
</script><noscript><img src="http://www.engadget.com/traffic/?t=px&bv=JavaScript+Disabled&os=&tz=default&lg=&rv=www.google.com.ph%2Fsearch%3Fsourceid%3Dnavclient-ff%26ie%3DUTF-8%26q%3Dlink%253Ahttp%253A%252F%252Fwww.engadget.com%252F2008%252F08%252F21%252Fdebunk-blackberry-bolds-browser-on-wifi-actually-not-that-slow%252F&rsv=www.google.com.ph&pw=%2F2007%2F07%2F17%2Fwifi-equipped-blackberry-8820-about-to-hit-the-streets%2F&cb=1386963257" alt="the end" width="1" height="1"border="0" /></noscript>

Thanks in advance. :)

deathshadow
Oct 19th 2008, 3:37 am
Basically what this does is use document.write to make a script that CALLS another script.

If you do

<script src="/linkto/yourscript.js" type="text/javascript"></script> it will load another javascript. That's basically all that document.write is doing - even inside script tags opening <script> will close the script tag prematurely, to prevent this this is using the common 'trick' of breaking up "<script>" into "<scr"+"ipt" - so the browser doesn't see that as a script tag while running the embedded script, but WILL see it as a script tag after it's been written to the page (and run it)

The rest of that is just browser sniffing/tracking info being sent to the script the document.write is calling.

natalie1981
Oct 19th 2008, 4:10 am
Thanks. So if it's calling out another script why is it showing up as a Google backlink even without the "href" tag? Oh, and does anyone know what kind of tracking script it is or could you suggest a similar script that allows Google to read it as a link to the site?