Forum Moderators: Robert Charlton & goodroi

Message Too Old, No Replies

document.write() links

Will Google follow html links written with document.write()?

         

minichate

6:43 pm on Jun 23, 2006 (gmt 0)

10+ Year Member



Hello all,
I've been asked to write a javascript that will update across various sites. Something that can be included like:
<script src="http://www.example.com/update.js type="text/javascript"></script>

My question is, if there is something like:


document.write('<a href="http://www.example.com">Example</a>');

in the code, will it be followed?

tedster

8:01 pm on Jun 23, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Once in a while the url may be followed, but such links are not followed routinely -- and they do not pass PR or link text influence.

londrum

8:50 pm on Jun 23, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



i read somewhere that links inside javascript will only be looked at if you include the full URL
..with the http:// at the beginning

SEOtop10

1:33 am on Jun 24, 2006 (gmt 0)

10+ Year Member



If possible, you might consider using PHP. Of course, it depends on whether you can develop the URL before the page has rendered.

PHP generated URLs will be followed and will pass PR and link text benefits.

minichate

1:29 am on Jun 25, 2006 (gmt 0)

10+ Year Member



If possible, you might consider using PHP

Not an option in this case. It's so that random people on the internet can include content on their site without them needing to resort to perl/PHP/whatever.

londrum

7:33 pm on Jun 25, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



are you saying that you need to write a snippet of code that other people can place on their own sites?

if that's the case, i wouldn't use document.write - because it's not forward compatable.
it doesn't matter too much now, as people are still serving XHTML pages as text/html, but document.write won't work on XHTML pages served as application/xhtml+xml

kaled

9:01 am on Jun 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It has been said that Googlebot may follow any url it finds that begins http: however, Googlebot does not routinely read external javascript. In addition, as has been said, no PR is likely to be passed.

Kaled.

fishfinger

11:42 am on Jun 26, 2006 (gmt 0)

10+ Year Member



Google Analytics counts document.write urls as links, but I have tested to see if they are not crawled and they are not.