A Random Ad Display Page : Random : Language Basics JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Language Basics » Random »

 

A Random Ad Display Page



<HTML>
<HEAD>
<TITLE>Displaying Random Ads</TITLE>
<SCRIPT LANGUAGE="JavaScript"><!--
    urls = new Array("http://www.navioo.com",
                     "http://www.google.com",
                     "http://www.navioo.com")
    function insertAd() {
        adIX = Math.round(Math.random()*(urls.length-1));
        document.write('<A HREF="'+urls[adIX]+'">');
        document.writeln('</A>');
    }
// --></SCRIPT>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="JavaScript"><!--
insertAd();
// --></SCRIPT>
<H1>Displaying Random Ads</H1>
</body>
</HTML>
           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Language Basics
» Random