programming-examples/js/Others/A Random Ad Display Page.js

27 lines
702 B
JavaScript
Raw Normal View History

2019-11-15 12:59:38 +01:00
<HTML>
<HEAD>
<TITLE>Displaying Random Ads - Happy Codings :-) C++, C#, HTML, Java, JavaScript Code Examples</TITLE>
<SCRIPT LANGUAGE="JavaScript"><!--
urls = new Array("http://javascript.happycodings.com/",
"http://csharp.happycodings.com/",
"http://html-css.happycodings.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>
<p>
Happy Codings :-) JavaScript Code Examples
<br>
</p>
</body>
</HTML>