Welcome to WebmasterWorld Guest from 54.145.23.244

Forum Moderators: open

Message Too Old, No Replies

what javascript does google read ?

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

Preferred Member

5+ Year Member

joined:Apr 29, 2008
posts: 624
votes: 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,
3:42 pm on Oct 9, 2012 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member ken_b is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Oct 5, 2001
posts:5713
votes: 66


I'm also interested in the answer to this question.
8:35 pm on Oct 9, 2012 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:12999
votes: 289


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>
6:58 pm on Oct 11, 2012 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member ken_b is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Oct 5, 2001
posts:5713
votes: 66


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

This goes in the htaccess file, right?

First, last, or?
12:31 am on Oct 12, 2012 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:12999
votes: 289


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.
2:01 am on Oct 12, 2012 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member ken_b is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Oct 5, 2001
posts:5713
votes: 66


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.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members