Free shared knowledge/information space
created for people like you by people like you!

ActiveHowTo.com - Free online how-to encyclopedia
Submit Article  | Feedback/Contact | 

Online Marketing :: General

How Search Engines Crawlers Treat Javascript

Recently, we have conducted an experiment, the aim of which was to truly establish how various search engines handle HTML PIN sites containing javascript and, in particular, redirections.

First of all: English is not my primary language.
I hope you'll excuse me for it and find this artice useful.

Recently, we have conducted an experiment, the aim of which was to truly establish how various search engines handle HTML PIN sites containing javascript and, in particular, redirections.


During experience on the front page of a site with good attendance and high positions in a Google on the profile keywords were added a few pages with different fragments js code for each of them. Javascript different ways redirected Web users to pages specially designed for the experiment, the and in no way linked with the site to maintain the cleanliness of the experiment. Thus, the search bot to reach the final only on the pages of the test scripts. The only thing left was to take some time to see server logs, which of the pages come web crawlers, and what is not.


Come to find out, Googlebot and other bots can handle almost all of the javascript included in the code pages, ie, automatically diverted seen, and the final index page.


In the first example, the code samples search bot, we see the standard redirect.


<script language=&rdquo;JavaScript&rdquo;><script language="JavaScript">

document.location.href = &ldquo;http://www.document.location.href = "http://www. site .com/ directory /1.html&rdquo;;site. com / directory / contents;

</script&gt;</script&gt;


In the second example tricks involves encrypted script :


&lt;script language=&rsquo;JavaScript&rsquo;>var str = &lsquo;wbs%21s%3Eepdvnfou%2Fsfgfssfs-u%3E%23 %23-r%3CBecause language='JavaScript'> var str = &lsquo;wbs%21s%3Eepdvnfou%2Fsfgfssfs-u%3E%23 %23-r%3C


%0B%21%21%21%21%21%21%21%21%21%21%21%21% 21%21


epdvnfou%2Fmpdbujpo%3E%23iuuq%3B00xxx%2F betpgu.efwfmpqnfou


%2Fdpn0uftukt03fod%2Fiunm%23%3C&rsquo;; str = unescape(str); res = &lsquo;&rsquo;; for (var i = 0; i &lt; str.length; i++){ res += String.fromCharCode(str.charCodeAt(i)-1); } eval(res);&lt;/script&gt;%% 2Fdpn0uftukt03fod 2Fiunm% 23% 3C '; str = unescape (str); res =''; for (var i = 0; i &lt;str.length; i + +) (res + = String.fromCharCode (str.charCodeAt (i) -1); ) eval (res); &lt;/script&gt;


The third example process to be part of the script in the iframe, it is successfully completed, and proceeded to :


<iframe xsrc=&rdquo;http://www.<iframe xsrc = "http://www. site .com/ directory / f .html&rdquo; width=&rdquo;100%&rdquo; height=&rdquo;100%&rdquo; frameborder=0 hspace=0 vspace=0 marginwidth=0 marginheight=0 allowtransparency=true scrolling=no></iframe>site. com / directory / f. html "width =" 100% "height =" 100% "frameborder = 0 hspace = 0 vspace = 0 marginwidth = 0 marginheight = 0 allowtransparency = true scrolling = no&gt; &lt;/iframe&gt;


But there have been exceptions. Here are snippets of javascript code that could serve to redirektom Internet-provodnica user, but not a search robot.


To the tricks was placed in such a way that the process and how it could either browser or crawler with the functions formatting and processing units HTML pages. Then look something like this :


< div style=”overflow:auto; height: 1px;”&gt<div style = "overflow : auto; height : 1px; "&gt;

<table width=&rdquo;100%&rdquo;>width="100%"> <table

&lt;tr&gt;n

&lttd id=&rdquofirst&rdquo&gtaassssssdddddffffgggghhhh jjjkklll&lt/td&gt&lttd id=&rdquofirst&rdquo&gtaassssssdddddffffgggghhhh jjjkklll

aassssssdddddffffgggghhhhjjjkklll

aassssssdddddffffgggghhhhjjjkklll

aassssssdddddffffgggghhhhjjjkklll

aassssssdddddffffgggghhhhjjjkklll

aassssssdddddffffgggghhhhjjjkklll

aassssssdddddffffgggghhhhjjjkklll

aassssssdddddffffgggghhhhjjjkklll

aassssssdddddffffgggghhhhjjjkklll

aassssssdddddffffgggghhhhjjjkklll

</tr>n


<tr>n

aassssssdddddffffgggghhhhjjjkklll

aassssssdddddffffgggghhhhjjjkklll

aassssssdddddffffgggghhhhjjjkklll

aassssssdddddffffgggghhhhjjjk&

#107lll

aassssssdddddffffgggghhhhjjjkklll

aassssssdddddffffgggghhhhjjjkklll

aassssssdddddffffgggghhhhjjjkklll

aassssssdddddffffgggghhhhjjjkklll

aassssssdddddffffgggghhhhjjjkklll

&lttd id=&rdquosecond&rdquo&gtaassssssdddddffffgggghhh hjjjkklll&lt/td&gt&lttd id=&rdquosecond&rdquo&gtaassssssdddddffffgggghhh hjjjkklll

</tr>n


</table></table>

</div></div>


&lt;script language=&rdquo;JavaScript&rdquo;&gt;&lt;script language="JavaScript"&gt;


var D=documentvar D = document


function AbsPos(O, Parent){AbsPos function (O, Parent) (

var X=0, Y=0, Next, D=document;var X = 0, Y = 0, Next, D = document;


Next=O; if (Parent==null) Parent=D;Next = O; If (Parent == null) Parent = D;

while (Next!=null &amp;&amp; Next!==Parent){while (Next! = null &amp; &amp; Next! == Parent) (

Y+=Next.offsetTop; X+=Next.offsetLeft; Next=Next.offsetParent;Y + = Next.offsetTop; X + = Next.offsetLeft; Next Next.offsetParent =;

}

return [X, Y];return [X, Y];

}


var first = AbsPos(D.getElementById(&rsquo;first&rsquo;));var first = AbsPos (D.getElementById ( 'first'));


var second = AbsPos(D.getElementById(’second’));var second = AbsPos (D.getElementById ( 'second'));


if (first[0] != second[0]) {if (first [0]! second = [0]) (

document.location.href = &ldquo;http:/&rsquo;+'/www.document.location.href = "http:/ '+' / www. site.com / directory / t .html&rdquo;site.com / directory / t. html ";

}


else {else (

document.write(&rsquo; whatever &lsquo;);document.write ( 'whatever');

}


</script >&lt;/script>


As it turned out, the search engines such properties do not possess. So only real users can be redirected to the actual destination.


The following example tricks was triggered onFocus :


<script language=&rdquo;JavaScript&rdquo;><script language="JavaScript">


function f(){function f () (

document.location.href = “http://www.document.location.href = "http://www. site .com/ directory / x .html”;site. com / directory / x. html ";

}


window.onFocus = f()window.onFocus = f ()


</script&gt;</script&gt;


Of course, here crawler did not succeed, because they do not carry out the necessary action.


In the third sample code URL appeared in the body of js object, but not as redirect.


<script language=&rdquo;JavaScript&rdquo;><script language="JavaScript">

function rnb() {rnb function () (

http://www.http://www. site .com/ directory / abc .htmlsite. com / directory / abc. html

}

&lt;/script>&lt;/script>


This link bot did not passed, which means another conclusion. Google and other search engines will be using javascript correctly, ie execute script and the "see" result of the script, but can't parse the script .


So take stock : major search engines and Google, in particular, can serve, but not the parse javascript. That is to say, they may be able to understand why this script made, and whether it innocuous script forming part of a dynamic presentation of the page, or the insidious search Optimizers. If the script is tailored to the specifics of its browser and search bot, it is possible to hide from search engines real purpose of your scripts. All of this looks like a reception Black Hat SEO, but in some cases it may be necessary for the more convenient it is a peace-loving purposes.







Article Source: www.activehowto.com
Share this article with others. Bookmark it at these sites:
                              

                              

                  

READ NEWEST ARTICLES HERE

Posted 2006-12-28 07:00:10  By
Views:
655


Submit Article

Activehowto.com :: Newest Submissions ?

  
Submit Article  | Feedback/Contact |  Terms Of Service  |  Links Directory
©2010 ActiveHowTo.com  All Rights Reserved.
RealWebMedia.com

GoDaddy.com FatCow $88 Plan for $66 only Buy.com