I have a problem with navigation elements being crawled on our SharePoint site. These elements come from a custom control that's used for building the site navigation, so the output is just html that might look like this simple example:
<div class="nav_root">
<ul class="nav_root_wrap">
<li class="SomeLink twoline first" id="SomeLink">
<a href="someLink.aspx">some link</a>
</li>
<li class="AnotherOption twoline second" id="AnotherOption">
<div class="flyoutMenu">
<a href="#">more links</a>
...
</div>
</li>
</ul>
</div>
It looks like adding the "noindex" class to the elements in the html should do the trick. However, because I don't have very much control over the css classes that get applied to this content on the server-side, I'm wondering if I can add some jquery like below to apply the css classes on the client-side.
$('.nav_root *').addClass("noindex");
Does anyone know if this should work in SharePoint 2010's Enterprise Search (i.e. not FAST Search Server)? I can't tell if the search crawler is going to allow javascript to run before looking at the content of the page.
Update: I'm not having any luck getting this to work. This seems to indicate that the content of the page is crawled without javascript being taken into account. I really hope that I'm just doing something wrong, so please let me know if this is not accurate.
Update2: It sounds like some folks have had luck creating a user control that prevents content from rendering for a particular user agent. Certainly an interesting option, though it's not what I'd hoped for: http://underthehood.ironworks.com/2010/05/sharepoint-search-partial-page-exclusion.html