View Full Version : External .js file and Google
Aussies-Online
29-08-2003, 11:55/11:55AM
I want to put a message on my pages for my visitors, but I don't want the robots to read it as it is not relevant to the page. Furthermore, having the same message on every page could hurt my site ratings as the robots are still not as smart as humans. lol
If I put the text in an external .js file, will that stop the robots reading it?
Farhan
29-08-2003, 12:16/12:16PM
How about writing the text as an image?
Aussies-Online
30-08-2003, 04:06/04:06AM
I could do that but I don't want it to look like a banner.
To not make it look like a banner, it will be too big and will slow my pages loading up. I have 3 or 4 lines of text to put in.
qwerty
30-08-2003, 08:21/08:21AM
This image is 2.5 K. That's not bad...
Aussies-Online
30-08-2003, 11:54/11:54AM
Very good! Qwerty
First, this is not 4 lines.
A line is 600 pixels wide.
Second, I am still waiting for someone to answer my question.
Can the robots read Javascript? Pleeeeeeeease:D
qwerty
30-08-2003, 11:58/11:58AM
No, I don't think they can read js. That's why they can't follow links within scripts. So, I guess you could declare a variable called something like msg and then do something like document.write(msg)
But I'm definitely not a javascript expert. When I need a script I just go out on the web and find a free one.
urbanlady
30-08-2003, 16:30/04:30PM
Depends on the robot. Some robots are a lot smarter than others. I think Google and most major search engines have smart robots as this would be necessary for effective indexing. Even some third party robots are quite smart and can follow Javacript links, an example of this is Teleport.
To make dynamic content you might try using PHP or something to write the stuff that you don't want the robots to follow. Maybe you could also put it in a frame somehow and keep reloading that frame. That might also be hard for robots to follow.
Regards,
Nancy Kramer
Webmaster http://www.americandreamcars.com
Free Color Picture Ads for Collector Cars
One of the Ten Best Places To Buy or Sell a Collector Car on the Web
Aussies-Online
31-08-2003, 10:29/10:29AM
Thank you for your replies.
I am no expert either in javascripts and just like you, I get them of the net.
Actually I have been trying to scroll a message on my status bar and I can't get it to work. That is as much as I know.
stevew
31-08-2003, 17:35/05:35PM
Originally posted by Aussies-Online
Can the robots read Javascript? Pleeeeeeeease:D
The generally-accepted rule is, no.
Though, as with Flash, they can follow navigation links, so will do if they "feel like it".
urbanlady
Depends on the robot. Some robots are a lot smarter than others. I think Google and most major search engines have smart robots
We have just re-engineered a website that (for good reason) has previously had all page content generated with javascript "document.write" commands : even navigation links.
The site has gone from nowhere in Google to top ten rankings almost immediately, featuring pages that weren't previously even indexed.
So, I would guess, that although Google probably *can* read javascript, it often *doesn't*.
Try this for your content:
var line1 = 'first line of content';
var line2 = 'second line of content';
var line3 = 'third line of content';
document.write(line1 + line2 + line3);
...and place it in an external .js file : I'd be sure the robots couldn't be bothered to do what's necessary to read it.
eznet
31-08-2003, 23:02/11:02PM
How about using an iFrame and a src page that uses a Robot Text File in order to exclude the robots?
Aussies-Online
01-09-2003, 05:32/05:32AM
Originally posted by stevew
The generally-accepted rule is, no.
Though, as with Flash, they can follow navigation links, so will do if they "feel like it".
That is news to me. I thought the robots could not follow links from flash navigation.
chopsticks
01-09-2003, 06:09/06:09AM
It seems the discussion has failed to answer the question at hand:
Can search engines (and google in particular) index EXTERNAL .JS files?
The answer is, yes, they can (by default).
Does it happen? Yes, sometimes.
However, the answer is mute because of the ROBOTS.TXT
----
i.e. DISALLOW the particular file you don't want to have indexed.
Disallow: /myExternal.js
Or, in the case of Google the almighty, you could
Disallow: *.js
(not all spiders will accept wildcards in the ROBOTS.TXT, but Google does)
stevew
01-09-2003, 07:45/07:45AM
Originally posted by Aussies-Online
That is news to me. I thought the robots could not follow links from flash navigation. Apparently, the technology is there.
But, since text content is all in image files, even if the technology is used (and I'm sure it isn't) this still leaves them at a dreadful disadvantage to HTML pages.
And I can't see them indexing image content any time soon ...:D
Aussies-Online
01-09-2003, 09:18/09:18AM
Thank you all.
Now I have hit a snag with my javascript.
I had it all working beautifully until I did place it in an external file.
I think the problem might be with the <body onload>
The script is in three parts.
The first part, between the <head> goes into the external file.
<SCRIPT type="text/javascript" language="JavaScript" src="http://www.aussies-online.com/javascripts/Localitystories.js"></SCRIPT>
Second part:
<BODY onLoad="initiate()" bgcolor="#FFFFFF" text="#000000">
Third part:
<DIV id=msgbg style="position: absolute;"></DIV>
<DIV id=msgfade style="position: absolute;"></DIV>
Can anyone gives me a clue? Thanks.
chopsticks
01-09-2003, 09:28/09:28AM
yeah, i'd recommend that you do NOT use the body onload to activate your javascript.
#1 many 3rd party pop-up blockers (even Google's toolbar) give options to disable the Body ONLOAD event since it's often used to spawn pop-up windows.
#2 don't assume that the visitor to your site would have a cached version of your external javascript! (that's the only way one could instantly activate the external javascript in a body onload event).
---
So, my recommendation would be to either:
A) have the javascript call/initialize itself. i.e. slap the 'initiate();' at the last line of your external javascript.
B) not as solid, but you could put the javascript 'intiate()' at the very very end of your HTML, just before the body closes.
Here is a link or two that may help you --
Common problems implementing code (http://www.dyn-web.com/tutorials/problems.html)
cr8asite forums - external javascript thread (http://www.cre8asiteforums.com/viewtopic.php?t=3167&start=0)
vBulletin® v3.8.3, Copyright ©2000-2010, Jelsoft Enterprises Ltd.