PDA

View Full Version : Yet another javascript link question



Westech
12-17-2003, 02:32 PM
I know that
document.write('<a hr' + 'ef="http://w' + 'ww.website.com">click here</a>');
will prevent PR from being passed to a link, but will PR be passed if it isn't broken up? Example:
document.write('<a href="www.website.com">click here</a>');

I'm looking at adding some functionality to my site that would let users post links without passing PR. The code would be much simpler if I could just surround the url with the javascript stuff rather than try to split it up.

Mike
12-17-2003, 02:56 PM
Why don't you try linking like out.php?siteid=1 ?

It's much simpler and I can give you the code if you want.

Westech
12-18-2003, 07:52 AM
Thanks for the suggestion Mike. I may hit you up for that code later for another project. In this case, I think it will be better to do it with the javascript trick since I want my users to be able to post links and heve them appear on my page in real time. I just need to know if search engines will recognize the link if I send it out with document.write without breaking it up.

Mike
12-18-2003, 10:11 AM
Fair do's:)

Can't help you on your question, sorry.

chromate
12-18-2003, 10:24 AM
Westech, it's not likely to be passed even if it's not broken up. The only reason to break it up is to be double sure. For instance, a search engine may read "<a href=" and think "ah, this must bust be a link". Where as if it's fragmented, it's less likely to match any pre-defined strings that would indicate a link.