Banner Click Redirection

[Total: 0    Average: 0/5]

This code will take a user from a banner ad click to this page to find out where to send the user onto from here.

Body Code:

This code pretents to be on a url with a parameter of ?p=1.<BR>
Given that the statement below would have been used in the code
(there is a variable MAKE_WORK that is set to false to keep that from
occuring now).
<script>  
var MAKE_WORK = false; // set to true to run this code.
function JS(_redir,_parm) {  
  if (_redir)       this.redir       = _redir;  
  if (_parm)        this.parm        = _parm;  
}  
JS.prototype.REDIR     = function() { return this.redir;       }  
JS.prototype.PARM      = function() { return this.parm;        }  



var myJS = new Array();  

    myJS[0] = new JS("ERROR 013: JavaScript Markup Language could not find specified variables or page.",  
                     "ERROR 013: JavaScript Markup Language could not find specified variables or page."); 

    myJS[1] = new JS("http://www.js-examples.com/",  
                     "1");  

    myJS[2] = new JS("http://www.js-examples.com/sporum/",  
                     "2");  


var _whichJS = 0;  
var _l = document.location.toString();  
    _l = "http://www.js-examples.com/test.html?p=1"; // added for test - remove to use this code
var _lookfor="?p";  // added for test
var _i = _l.indexOf(_lookfor);  
//document.write("<BR>index="+_i+"<BR>"); // added for test
if (_i != -1) {
  var _y = _l.substr(_i+_lookfor.length+1,_l.length);  
  //document.write("y="+_y+"<BR>"); // added for test
  for (var _a=0; _a < myJS.length; _a++) {  
    if (myJS[_a].PARM() == _y) {  
  _whichJS = _a;  
  //document.write("whichjs="+_whichJS+"<BR>"); // added for test
}  
  }  
}  
var A = MAKE_WORK?"<":"&lt;";
document.write(A+'meta http-equiv="refresh" content="0; url= ' + myJS[_whichJS].REDIR() + '  ">');
if (A)
document.write("<BR>url="+myJS[_whichJS].REDIR());
</script>  

Times Viewed: 3

Leave a Reply

Your email address will not be published. Required fields are marked *