How to add simple Timer to Landing Page.

Most of the PIN Submit offers that cloud the Affiliate Marketing in Mobile are found to have a reducing clock timer that ticks every second and redirects to a specific landing page or affiliate offer.

Its very simple to create such a timer on any page given that the person knows how to edit HTML, and do some coy paste.

First and foremost thing is HTML has tags, id’s which are same as XML, and hence whenever we want to refer a specific part of the page element we can easily get hold of that element using document handlers.

If a page has a css element with id <div id=’timer’></div> we can easily make it a timer element using simple javascript function below.
[cc lang=”JavaScript”]

var count=30;
var counter=setInterval(timer, 1000); //1000 will run it every 1 second

function timer(){
count=count-1;
if (count <= 0){
clearInterval(counter);
return;
}
document.getElementById(“timer”).innerHTML=count + ” seconds”; // watch for spelling
}
[/cc] Simple isn’t it??