Using js files for sidebar links good or bad?

Discussion in 'HTML & Website Design' started by xyphlo, Feb 15, 2009.

  1. #1
    I just realized that using .js files (ex. SCRIPT language="JavaScript" type="text/JavaScript" src="onlineresources.js"> )for my sidebar links makes it easy to make changes without going page file by page file, but the links aren't showing up as inbound links in a recent SEO report that I got. When I mouse over the page link, an address doesn't show up at the bottom of my browser like my other links. Should I be using something else for my navigational menus? I have these command set up on the other side ><?include("tpl/advertisers.html");?>. Is this better? They were created by different people.
     
    xyphlo, Feb 15, 2009 IP
  2. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #2
    It is absolutely a Bad Idea to use javascript to generate links&#8212;at least if you want search engines to see them, or you want people with javascript turned off (a larger number than you'd think) to see them.

    Use the includes.

    cheers,

    gary
     
    kk5st, Feb 15, 2009 IP
  3. xyphlo

    xyphlo Member

    Messages:
    83
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #3
    Thanks for the info. I wish I would've known this earlier since my site has been this way for over a year. Now I'm tring to convert .js files to html and have no idea how to do it. Any advice there?
     
    xyphlo, Feb 16, 2009 IP
  4. xyphlo

    xyphlo Member

    Messages:
    83
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #4
    My .js file looks like this:

    menu_name=new Array();
    menu_link=new Array();
    menu_name[1]="Link 1";
    menu_link[1]="http://www.site.com";
    menu_name[2]="Link 2";
    menu_link[2]="]="http://www.site.com";
    menu_name[3]="Link 3";
    menu_link[3]="]="http://www.site.com";
    menu_name[4]="Link 4";
    menu_link[4]="]="http://www.site.com";
    menu_name[5]="Link 5";
    menu_link[5]="]="http://www.site.com";
    menu_name[6]="Link 6";
    menu_link[6]="]="http://www.site.com";
    menu_name[7]="Link 7";
    menu_link[7]="]="http://www.site.com";
    menu_name[8]="Link 8";
    menu_link[8]="]="http://www.site.com";
    menu_name[9]="Link 9";
    menu_link[9]="]="http://www.site.com";



    for (cur=1;cur<menu_name.length;cur++)
    {
    document.write("<TABLE cellSpacing=0 cellPadding=0 width=170 bgColor=#f8f7f5 border=0>");
    document.write("<TBODY>");
    document.write("<TR class=button_level1_main_1 id=menu_"+(cur-1)+" onmouseover=\"ov_M_main('menu_"+(cur-1)+"')\" onclick=\"document.location.href='"+menu_link[cur]+"'\" onmouseout=\"ot_M_main('menu_"+(cur-1)+"','button_level1_main_1')\">");
    document.write("<TD vAlign=center align=left height=20>");
    document.write("<TABLE height=1 cellSpacing=0 cellPadding=0 width=170 bgColor=#ffffff border=0>");
    document.write("<TBODY>");
    document.write("<TR>");
    document.write("<TD vAlign=center align=middle width=20></TD>");
    document.write("<TD></TD></TR></TBODY></TABLE>");
    document.write('<TABLE height="100%" cellSpacing=0 cellPadding=0 width=170 border=0>');
    document.write("<TBODY>");
    document.write("<TR>");
    document.write('<TD vAlign=center align=middle width=20><IMG height=7 src="images/arrow_black_nofill.gif" width=7></TD>');
    document.write('<TD>');
    document.write('<TABLE cellSpacing=3 cellPadding=0 width="100%" border=0>');
    document.write('<TBODY>');
    document.write('<TR>');
    document.write('<TD>'+menu_name[cur]+'</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>');
    }
     
    xyphlo, Feb 16, 2009 IP
  5. unigogo

    unigogo Peon

    Messages:
    286
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #5
    If the links of sidebar are keeping changing, it's more convenient to use one js file for all pages. It must not have all the links appear in all pages for search engine to see. The valued links must be relevent to the content of that page. The more links, the more they will dilute the PR of the page.
     
    unigogo, Feb 16, 2009 IP
  6. bz1406

    bz1406 Peon

    Messages:
    93
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Thx for the tips guys, i'll try it to mysites
     
    bz1406, Feb 16, 2009 IP
  7. xyphlo

    xyphlo Member

    Messages:
    83
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #7
    I'm sure it's better to use a js file for my outgoing affiliate links than for my site inbound links.
     
    xyphlo, Feb 17, 2009 IP
  8. eclipsemedia

    eclipsemedia Peon

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Why not just leave your links as is and at the footer of your page. Create the same links in a horizontal menu bar using just simple <href tags and CSS. This way you will save time and have clean links to Search Engines to pick up on. This is a common procedure for those who have flash buttons (although apparently Google can now index SWF files) i hope this helps
     
    eclipsemedia, Feb 17, 2009 IP
  9. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Answer was stated already.
    Google "php include" (assuming you're using PHP) if you're new to them.

    Why would you use JS for ANY links? Doesn't matter if they're inbound, outbound, in your butt... Do you want everyone (humans and robots) to be able to click them and get somewhere? Then don't use JS (or Flash; yes if you use the Accessibility feature in Flash Google can index it but you're still saying Screw You to folks visiting who don't have Flash... Flash Menus Suck, avoid them).
     
    Stomme poes, Feb 25, 2009 IP