homepage Welcome to WebmasterWorld Guest from 54.196.159.11
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
what javascript does google read ?
member22




msg:4505855
 9:28 am on Oct 9, 2012 (gmt 0)

Hello,

I have the following javascript for the menu on my site and was wondering if google can read it ?

<script type="text/javascript" src="/modules/mod_djmultitreemenu/assets/js/djmultitreemenu.js"></script>
<script type="text/javascript">

I also have modules with the following code <script type="text/javascript" src="http://www.mywebsite.com/modules/mod_yoo_carousel/mod_yoo_carousel.js"></script>

Can google read what is inside it ?

and should I block the javascript in my robots.txt file or shouldn't I block it ?

Thank you,

 

ken_b




msg:4505973
 3:42 pm on Oct 9, 2012 (gmt 0)

I'm also interested in the answer to this question.

lucy24




msg:4506139
 8:35 pm on Oct 9, 2012 (gmt 0)

should I block the javascript in my robots.txt file or shouldn't I block it ?

Wrong question. The question is whether you should block it absolutely-- in config or htaccess-- because Preview, Translate and so on aren't bound by robots.txt.

Are you asking whether google can find the file, or whether they can read it? They can definitely find it; quick detour to raw logs confirms that they occasionally ask for .js files. Presumably for indexing purposes, which means it's time to whip out the

:: shuffling papers ::

<FilesMatch "\.(js|txt|xml)$">
Header set X-Robots-Tag "noindex"
</FilesMatch>

ken_b




msg:4507025
 6:58 pm on Oct 11, 2012 (gmt 0)

<FilesMatch "\.(js|txt|xml)$">
Header set X-Robots-Tag "noindex"
</FilesMatch>

This goes in the htaccess file, right?

First, last, or?

lucy24




msg:4507138
 12:31 am on Oct 12, 2012 (gmt 0)

You mean, where in htaccess does it go? Doesn't matter. Ordering in htaccess only makes a difference within individual modules. This one's a free-standing directive. Unless you've got something else in htaccess that says "yes! index all you like! override all other instructions!" and it overlaps the js/txt/xml group. This does not seem likely.

They probably use js when constructing Previews. But I can't personally check, because my js tend to involve fonts-- or piwik tracking-- so the default version is the same as the <noscript> version.

ken_b




msg:4507152
 2:01 am on Oct 12, 2012 (gmt 0)

You mean, where in htaccess does it go?

Yes, thanks for the explanation.

Try as I might, I have a hard time getting a grip on this stuff.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved