If you type a search query on dictionary.reference.com, the page immediately turns blank, and then the new page loads. Did you ever notice this? On other websites, the page you're on stays visible until the page with the search results loads.
Initially I thought this is actually a nice idea; it makes it more obvious to the user that your search query is being processed. If all websites behaved this way, it might increase overall usability of the web slightly.
But today I noticed that if you use the browser's "Back" button, you can actually navigate to that blank page. You have to use "Back" twice to get back to the previous non-blank page. That is, of course, hardly a usability benefit: it is potentially confusing.
Given the above observations, I theorised that the system probably loads a page containing nothing but a <meta name='refresh' content='...'> tag. While that would be unusual in the sense that few other websites do the same, it still seemed reasonable that one would do that if the above usability improvement was the goal.
Today I investigated what is actually going on. It is quite a bit weirder than this. First of all, the above only applies if you allow JavaScript to run. Otherwise the search box will just take you to /dic?q=sound (using "sound" as the example word to look up) and this will display the dictionary entry directly, not even forward you to the (apparently canonical) URL /browse/sound, which displays the same content.
If you do have JavaScript enabled, when you submit the form the function formcheck() is executed:
<script type="text/javascript">
function adcall(){
var adTarget;
adTarget ='/site=dictionary.com/area=search/aamsz=720x300/keyword=sound'+
'/pageid=' + aamPageId +'/random=' + aamRndNum;
document.writeln('<scr' + 'ipt language="javascript" type="text/javascript"' +
' src="' + adServer + '/jserver' + adTarget + '"></scr' + 'ipt>');
}
//todo: revisit this to handle empty query string, domains
function formcheck() {
if(document.getElementById("q") != null){
var q = document.getElementById("q").value;
var redirectURL = "http://dictionary.reference.com/browse/" + enc(q) + "";
adcall();
location.href = redirectURL;
}
}
</script>
Disregarding for a moment the "todo" comment on a live production site, do you notice something here? The function calls adcall();, which outputs a JavaScript tag to the page, and then immediately obsoletes that by assigning to location.href.
Turns out the document.writeln call replaces the entire page with this script tag. This is how you get the blank page so quickly. But then the assignment to location.href takes over and takes you to the correct page. If you use the "Back" button, you get to see the beauty of the blank page with the lone JavaScript tag on it (I've word-wrapped the URL for you, in the original it's all in one line):
<script language="javascript" type="text/javascript"
src="http://iacas.adbureau.net/jserver/site=dictionary.com/area=search
/aamsz=720x300/keyword=/pageid=830248663/random=6612083315"></script>
Just for a laugh, I followed the src attrbute to see what this JavaScript does. The contents of this URL are:
document.writeln('<scr' + 'ipt src="' +
'http://iacas.adbureau.net//AFTRSERVER/jserver/site=dictionary.com/area=search
/aamsz=720x300/keyword=/pageid=830248663/random=6612083315' +
'/ATCI=' + '0-0' + '"></scr' + 'ipt>');
Yet another document.writeln with another JavaScript tag! Let's follow it!
document.writeln("<a href=\"http://iacas.adbureau.net/accipiter/adclick/CID=fffffffcfffffffcfffffffc
/site=dictionary.com/area=search/aamsz=720x300/keyword=/pageid=830248663/random=6612083315/ATCI=0-0\"
target=\"_blank\"><img src=\"https://a248.e.akamai.net/img.adbureau.net/iacas/accipiter/images/AE13.gif\"
width=-1 height=-1 border=\"0\"></a>");
document.close();
Yet another document.writeln! But this time it outputs an image with a link instead of a JavaScript tag. Notice the width=-1 height=-1?
But anyway — even if I didn't use AdBlock, I'd never see this ad banner because of the assignment to location.href. So what was the point in all that? |