Forum Moderators: open

Message Too Old, No Replies

HTML links vs Javascript links

What to do if you need hierarchical menús?

         

silverbytes

1:33 am on Oct 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



HTML links works fine and are spider friendly. But it doesn't happen the same with jscript links.

So what to do if you need hierarchical menus to let users get your pages and subpages from the navigation bar all over the site?

Jack_Frost

1:59 am on Oct 5, 2004 (gmt 0)

10+ Year Member



Sometimes we'll put menus at the bottom of the page for the most important sub pages. It seems to be one of the least obtrusive ways to do it in my opinion.

raywood

6:08 pm on Oct 5, 2004 (gmt 0)

10+ Year Member



I don't understand exactly what the difference is. I want to display a long list of products one page at a time, with about 5 to 10 products on each page. To navigate the pages I will put links on the pages.
So if use a link like
javascript:_doPostBack('LinkButton1',") I think the search engines won't follow it.
But what if I use
<a id="UserControl_LinkButton1" href="javascript:__doPostBack('UserControl1$LinkButton1','')">forward</a>
It's formed like an html link. Would the search engine follow this link? If so, I think I can get all the pages crawled and indexed instead of just the first one.

Bernard Marx

7:24 pm on Oct 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Would the search engine follow this link?

No. It would be looking for the page: [_path_]javascript:__doPostBack....
..which it may just find a little confusing.

(although I should point out that SEO isn't a personal strong point) My recommendation would be something like:

[pre]
<a href="_path_to_page_or_anchor_"
id = "_id_"
onclick="someFunction(this.href or this.id);return false;">
[/pre]

Now, everything is present, and searchable.
If it is the kind of menu system that degrades gracefully to a fully-exposed list if Javascript is disabled, then the links will be used by humans too.

DrDoc

9:40 pm on Oct 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



...and then the link will also work (regardless of whether JavaScript is enabled or not) for us who like to open links in new tabs/windows.

raywood

4:49 am on Oct 6, 2004 (gmt 0)

10+ Year Member



Ok, thanks for the help. So now I change course. I use a server side script to increment the desired page number every time the page is requested. The page posts back to itself, and a query string in the link is incremented. So the now the link looks like:
<a href="thispage.aspx?page=2">next page</a>
Will the search engines follow that one?