So, I have a HTML page with links to video files on my server. What I need is, when someone clicks on the video links, a script should start loading up the advert from Google Adsense.
And after 10 seconds, it should be automatically redirected to the video file.
How can I do this?
Thanks
Isn't that illegal?
You need to change the link to the video with a simple text (in ) and add the "onClick" attribute which will activate a JS function.
<div onClick="javascript:showAdvertAndRedirect('http://www.video.com/id/23233')">Click to see the video</div>
The js function will show the ad (by changing another div's innerHTML) and will also run a timer of 10 seconds (actually a delay) , eventually will redirect the visitor to the mentioned url.
I'm sure that goes against the crazy adsense TOS. Read them again before getting banned.