Реферат: Совершенная 404-ая страница
{
blnSearchReferral=true;
//get site domain — split at the first forward-slash
var arrSite=strReferrer.split("/");
// now find search parameters
var arrParams=strReferrer.split("?");
var strSearchTerms = arrParams[1];
arrParams=strSearchTerms.split("&");
strSite=arrSite[2];
var sQryStr="";
//define what search terms are in use by the »
different engines
var arrQueryStrings = new Array();
arrQueryStrings[0]="q="; //google, altavista, msn
arrQueryStrings[1]="p="; //yahoo
arrQueryStrings[2]="ask="; //ask jeeves
arrQueryStrings[3]="key="; //looksmart
for (i=0;i<arrParams.length;i++)
//loop through all the parameters in the referring »
page’s URL
{
for (q=0;q<arrQueryStrings.length;q++)
{
sQryStr = arrQueryStrings[q];
if (arrParams[i].indexOf(sQryStr)==0)
{//we’ve found a search term!
strSearchTerms = arrParams[i];
strSearchTerms = strSearchTerms.split(sQryStr);
strSearchTerms = strSearchTerms[1];