Forum Moderators: open

Message Too Old, No Replies

JavaScript appearing in results?

... reloadPage; } document.onmousedown = down; document.onmouse...

         

Virgin Radio

3:45 pm on Nov 29, 2002 (gmt 0)

10+ Year Member



Looking for our site in Google...
Eurgh. It's grabbed hold of our JavaScript, and used it as part of its description. Which isn't nice, really.

Apart from cloaking (i.e. don't show JavaScript to Googlebot), is there a better way to make sure that our Java doesn't show up in Google?

[edited by: heini at 4:05 pm (utc) on Nov. 29, 2002]
[edit reason] no specifics / urls per TOS / thanks! [/edit]

nicebloke

4:00 pm on Nov 29, 2002 (gmt 0)

10+ Year Member



I like this bit best:

<meta name="hellogeeks" content="Hello you source-reading types. What on earth are you doing? You can't go nicking all this, you know, we'll call the bobbies.">

Putting the js in an external file normally does the trick, I believe.

ViruS

4:08 pm on Nov 29, 2002 (gmt 0)

10+ Year Member



I think it's because of

document.write('<script language="javascript" src="/js/newsdetails.js"></script>');

try to replace it with:
document.write('<'+'script language="javascript" src="/js/newsdetails.js"></'+'script>');

gsx

8:22 pm on Dec 2, 2002 (gmt 0)

10+ Year Member



Have you used JavaScript properly, by commenting it out?

You should have:

1) Starter: <script>
2) HTML Comment tag: <!--
3) Javascript: ...
4) Javascript comment tag and HTML Comment tag: //-->
5) End: </script>

All in all:
<script>
<!--
...
//-->
</script>

Virgin Radio

9:35 pm on Dec 4, 2002 (gmt 0)

10+ Year Member



ViruS, that looks like just the ticket, thanks. I've re-uploaded the Javascript include... our site gets re-indexed by Google at least every week so we should see the results very shortly.

Here's hoping the nasty JavaScript has been removed, ViruS - thank you!

[edited by: Marcia at 12:59 pm (utc) on Dec. 6, 2002]
[edit reason] TOS # 24, please see stickymail [/edit]

ikbenhet1

11:30 am on Dec 6, 2002 (gmt 0)

10+ Year Member



How is Google caching pages sucsesfully?
Relative urls create 404 error in the cache, and also relative popups cause a 404 error too.

so <script src="\external.js"> is a relative url right?

Google would have to rewrite those lines to full urls, but they don't, right?.
So somehow it sounds logical that javascript get's included in the cache, but not executed. Or not?

So if we use external script, the .js file get crawled, but not if we disguise the <script>?

DrOliver

1:16 pm on Dec 6, 2002 (gmt 0)

10+ Year Member



so <script src="\external.js"> is a relative url right?

Try this instead:
<script src="/external.js">

Don't know the answer to your question, though.