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.
It is absolutely a Bad Idea to use javascript to generate links—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
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?
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>'); }
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.
I'm sure it's better to use a js file for my outgoing affiliate links than for my site inbound links.
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
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).