Forum Moderators: Robert Charlton & goodroi
<FilesMatch "\.(js|txt|xml)$">
Header set X-Robots-Tag "noindex"
</FilesMatch>
Seems like you're asking about two different things: indexing javascript, and acting on javascript. Personally I take no chances, and have this in htaccess:
<FilesMatch "\.(js|txt|xml)$">
Header set X-Robots-Tag "noindex"
</FilesMatch>
Crawl, yes. Execute, yes. But do you want the actual content of your js files to show up in searches?
Do you have pages that are only accessible via javascript? Have the major search-engine robots crawled these pages?
<noscript>
<p>Put the contents [images,text,links,etc.] you want to make sure bots and those not executing JS for some reason see -- Then it won't matter if a visitors "runs the javascript" to see what you're presenting. They'll get the same info/images without JS, but won't have the use of the slideshow or any other JS dependent actions.</p>
</noscript>
What do you mean with the actual content of the js. file to show up in searches?
That's assuming some of your scripts are in separate files. If someone did an exact-text search for, say, "The navigation tabs can be placed on top or at one of the other edges" they might find one of your pages-- but you wouldn't want them to find
:: detour to make sure this isn't the filename you really use ::
www.example.com/helenscripts.js
<noscript>
<img src = "images/singlepix.gif" width = "1" height = "1" alt = "">
</noscript>
You can test it easily if you feel like doing the work.
<noscript>
<img src = "images/singlepix.gif" width = "1" height = "1" alt = "">
</noscript>
Shove into your universal footer, sit back for a week or so and look at requests for /singlepix.gif as a proportion of total human requests. If you're running analytics this information should already be available; I don't know about GA, but piwik has a no-script alternative that works on this principle.
Honestly I don't think there are many, though. People at WebmasterWorld have got to be overrepresented among both noscript and cookie-blocker types.