It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

Javascript and nofollow

Javascript and nofollow

Postby sfifabian on Wed May 21, 2008 10:38 pm

Hello, I'm new here
I have a question: how can I add the nofollow tag to the links I have in this banner rotator?




Code: Select all
<script type="text/javascript">
<!-- Begin
rnd.today=new Date();
rnd.seed=rnd.today.getTime();

function rnd() {
        rnd.seed = (rnd.seed*9301+49297) % 233280;
        return rnd.seed/(233280.0);
};

function rand(number) {
   var result = Math.ceil(rnd()*number);
   if (!result)result++;
        return result
};
var ad_cnt2 = 2;
var ad2 = rand(ad_cnt2);
var link2;
var adBanner2;
var width2
var height2
if (ad2==1) {
link2="http://TheSpiderWebSystem.com/greatnews";
adBanner2="http://thespiderwebsystem.net/spiderweb/s/728x90_wide.gif";
width2="728";
height2="90";
alt2="";
}
if (ad2==2) {
link2="/paidads.html";
adBanner2="/headerbanner.gif";
width2="728";
height2="90";
alt2="";
}
document.write('<center><a href="' + link2 + '" target="_blank">');
document.write('<img src="' + adBanner2 + '" width=' + width2 + ' height=' + height2 + ' border=0 alt="' + alt2 + '"></a>');
document.write('</center>');
// End -->
</SCRIPT>


Thank you!
sfifabian
 
Posts: 0
Joined: Wed May 21, 2008 10:35 pm

Postby rangana on Thu May 22, 2008 1:03 am

Add the highlighted:

document.write('<center><a href="' + link2 + '" target="_blank" rel="nofollow">');
User avatar
rangana
500+ Club
 
Posts: 935
Joined: Wed Feb 27, 2008 5:14 am
Location: Cebu City Philippines

Postby webmaster on Thu May 22, 2008 7:18 am

I guess you would like to add the nofollow because of the search engines, but they can't read javascript links anyways. So if it's for that reason, you don't have to do it.
Make sure to check out our TNX Review and Link Vault Review
User avatar
webmaster
Site Admin
 
Posts: 2695
Joined: Tue Aug 17, 2004 1:07 pm
Location: Sweden

Postby rangana on Thu May 22, 2008 7:37 am

Hi webmaster,

Just to clarify, does'nt SE reads the contents of document.write as it's outputs markups?
User avatar
rangana
500+ Club
 
Posts: 935
Joined: Wed Feb 27, 2008 5:14 am
Location: Cebu City Philippines


Who is online

Users browsing this forum: No registered users and 7 guests