Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,195,895 members, 7,959,813 topics. Date: Friday, 27 September 2024 at 07:56 AM |
Nairaland Forum / Science/Technology / Programming / simple ad Code (1147 Views)
Facebook And Instagram Ad Issues / Use Your Internet As A Text Editor Without Any Ad-on Or Pluggin / Review My Classified Ad Android App (2) (3) (4)
simple ad Code by Nobody: 6:18pm On Sep 26, 2015 |
<language="JavaScript"> images = new Array(3); images[1] = "<a href ='nerdslot.com' rel='nofollow' ><img src='http://imagizer./img661/7543/BJ28kI.jpg' border='0' height='60px' width='468px' alt='tech blog'>"; index = Math.floor (Math.random() * images.length); document.write(images [index]); </img src='http:></a></language="javascript"> |
Re: simple ad Code by Nobody: 6:36pm On Sep 26, 2015 |
It is a simple java ad code . The ad code i wrote is not redirecting to the target destination |
Re: simple ad Code by Nobody: 7:06pm On Sep 26, 2015 |
The url suppose to be http://www.nerdslot.com
but the ads is not neat and errors in html code |
Re: simple ad Code by Craigston: 8:37pm On Sep 26, 2015 |
Check your JavaScript console for error logs. This line index = Math.floor (Math.random() * images.length);does something interesting. Read up a reference on it. It generates a random number from 0.1 to 1. You multiply that number by another number and you get a number greater than zero and less than or equal to the second number. You pass the result to the floor()method of the Mathobject and you get a value rounded to the lower nearest integer. So your program likely does not return '1' which is the length of your array. It is written to return a random number. Let us say it goes this way. Math.floor(Math.random() * index.length) 1 Like |
Re: simple ad Code by Nobody: 3:23pm On Sep 27, 2015 |
Craigston: thanks I will try it later |
Re: simple ad Code by Nobody: 1:49pm On Sep 28, 2015 |
<script>
language="JavaScript">
images = new Array(3);
images[0] = "<a href = 'URL
OF ADVERTISER '
rel='nofollow' ><img
src=' URL OF BANNER’S
IMAGE ' border='0'
height='60px' width='468px'
alt=' AD DESCRIPTION' ></
a>";
index = Math.floor
(Math.random() *
images.length);
document.write(images
[index]);
</script> |
Re: simple ad Code by Craigston: 10:50pm On Sep 29, 2015 |
proxy20:Does it now work? |
Re: simple ad Code by Nobody: 7:00am On Sep 30, 2015 |
I am using this code
<a href=" TARGET URL "
target="_blank"><img border="0"
src=" IMAGE URL " width="300px"
height="250px"/></a> |
Re: simple ad Code by Nobody: 7:01am On Sep 30, 2015 |
Craigston:yes, it works |
(1) (Reply)
Nairaland Topic Re-direction Error / Software Testing In Africa - A New Community / Toptal: An Opportunity For Programmers And Designers To Earn Major Income
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 15 |