Graham
Keyarn its buzzcity's script it will only work for buzzcity
I have no idea about ad scripts
Keyarn
Graham But can you elp me code anodat one with
http://wap4dollar.com/ad/serve.php?id=9zxsoiy497 and image src= http://wap4dollar.com/ad/imgs/wap4dollar_banner_6.jpg
Copy code that will work exatly like dat of buzzycity?
Graham
Keyarn surely wap4dollar supply their own javascript
as I said I have no idea about ad company code
Keyarn
Graham Ok thanks sir. But plz sir i also av dis one
<script> var x = document.getElementsByClassName("myads");
var y = Math.floor(Math.random() * x.length);
var z = Math.floor(Math.random() * x.length);
x[y].innerHTML = '\<div class=\"ad\"\>\<b\><div class="full" style="background:url(/B/Bg/download.png)"><table cellspacing="0px"><tr align="middle"><td align="left"><img src="http://keyarn.xtgem.com/admin/Icons/ad.png" alt="**" class="ico" width="27px" height="30px" /></td><td align="left"><br/><a href="http://wap4dollar.com/ad/serve.php?id=9zxsoiy497"><img src="http://wap4dollar.com/ad/imgs/wap4dollar_banner_6.jpg" width="300" height="50" alt="" /></a></td></tr></table></div><hr style="border:1px dotted red;"/>\</b\>\</div\>';
x[z].innerHTML = '\<div class=\"ad\"\>\<b\><div class="full" style="background:url(/B/Bg/download.png)"><table cellspacing="0px"><tr align="middle"><td align="left"><img src="http://keyarn.xtgem.com/admin/Icons/ad.png" alt="**" class="ico" width="27px" height="30px" /></td><td align="left"><br/><a href="http://wap4dollar.com/ad/serve.php?id=9zxsoiy497"><img src="http://wap4dollar.com/ad/imgs/wap4dollar_banner_3.jpg" alt="" /></a></td></tr></table></div><hr style="border:1px dotted red;"/>\</b\>\</div\>';
</script>
Copy code and it is displaying only in one class named "myads" xo my question now is how will i duplicate the classes asin i want it to show in two or tree classes plz sir elp me
Graham
Keyarn wrap it in a 'for' loop
<script> var x = document.getElementsByClassName("myads");
for (i=0;i < 2;i++){
........
}
although it could overwrite the same element
so think of the setting as a maximum
If you want it so there are always the same number of ads
<script> var ads = document.getElementsByClassName("my_ads");
for (i=0;i < 3;i++){
var ad = Math.floor(Math.random() * ads.length);
if (ads[ad].innerHTML==''){
ads[ad].innerHTML = 'the ad code goes here';
}else{
i--;}}
</script>
Copy code If the ad has already been set it repeats the iteration by subtracting 1 from the loop count
Keyarn
Graham Ok thank you sir i understand this one it realy elp me
Keyarn
Graham Plz sir how can i change dat wap4dollar img banner inside this script
<script> var x = document.getElementsByClassName("ads_pop_in");
var y = Math.floor(Math.random() * x.length);
var z = Math.floor(Math.random() * x.length);
x[y].innerHTML = '\<div class=\"ad\"\>\<b\><div class="full" style="background:url(/B/Bg/download.png)"><table cellspacing="0px"><tr align="middle"><td align="left"><img src="http://keyarn.xtgem.com/admin/Icons/ad.png" alt="**" class="ico" width="27px" height="30px" /></td><td align="left"><img src="http://keyarn.xtgem.com/Admin/rating.gif" /><br/><a href="http://wap4dollar.com/ad/serve.php?id=9zxsoiy497"><img src="http://wap4dollar.com/ad/imgs/wap4dollar_banner_6.jpg" width="300" height="50" alt="" /></a></td></tr></table></div><hr style="border:1px dotted red;"/>\</b\>\</div\>';
x[z].innerHTML = '\<div class=\"ad\"\>\<b\><div class="full" style="background:url(/B/Bg/download.png)"><table cellspacing="0px"><tr align="middle"><td align="left"><img src="http://keyarn.xtgem.com/admin/Icons/ad.png" alt="**" class="ico" width="27px" height="30px" /></td><td align="left"><img src="http://keyarn.xtgem.com/admin/rating.gif" /><br/><a href="http://wap4dollar.com/ad/serve.php?id=9zxsoiy497"><img src="http://wap4dollar.com/ad/imgs/wap4dollar_banner_3.jpg" alt="" /></a></td></tr></table></div><hr style="border:1px dotted red;"/>\</b\>\</div\>';
</script>
Copy code to this my js file
<script language="javascript" src="http://keyarn.xtgem.com/Ads.js"></script></center></div></a>
Copy code asin i want to use that my js file as the inner html because the wap4dollar img banner does not change that is why i want to chang but iam unable to do that due to that my Ads.js is also a script. Plz can you help me out?
Graham
Keyarn A script inside a <a> tag inside a script I don't think that will work anyway
you could try turning Ads.js into a function that just returns the src of the image the rest of the html is the same anyway
strip out the html and wrap the whole contents of Ads.js in
function ads(){
.......
}
replace
document.write(quotes[whichquote])
with
return quotes[whichquote]
put <script language="javascript" src="http://keyarn.xtgem.com/Ads.js"></script>
above this script and change the img src to
src="'+ads()+'"
I have not tested it though
Also in Ads.js
calling the ad/serve.php as a background: in a style parameter ??? is that right anyway
isn't it meant to be a link ??? plus the () brackets are not closed either
I dunno
Keyarn
Graham am confused, where am i to put function ads?. is it inside the Ads.js or in the 1st script i droped?
Graham
Keyarn in Ads.js it only needs to return the random src for the image
Or you could just add the whole function to the top of the first script and don't bother with Ads.js at all
The array elements only need to hold the address of the images no html
The function is called in the first script as
src="'+ads()+'" inside the wap4dollar ad links <img> tags