Is it a bad/good idea to cloak offsite urls in the html using javascript? i.e.: Function(){ var a = 'http://www.'; var b = 'offsite'; var c = '.com'; var realURL = a + b + c; e.g.: document.getElementById('myID').href= realURL;} There are 2 reasons I want to do this: 1) If my site does not have exactly what the user wants I can offer the user a secondary search ... which is really an affiliate link to a well known affiliate-host. And 2) to reduce the number of offsite links in the html. Are there "bad" risks relative to crawlers by doing this? Thanks for your feedback!
1) People without javascript can not click them. 2) I think links out count towards your pageranks and things of that sort I could be wrong though.
that's the point though - link outs 'spill' rank hence you are advised to use nofollow. doing it via JS will have a positive effect - if any - from a SEO point of view. as for the old chestnut of 'users w/o javascript' - when are we going to stop building sites for people that refuse to equip themselves? tools for the job, is what i always say. if you want to go up a mountain and ski, then don't bring your skis, that's your problem, you cant expect all lifts to be accommodating and allowing you to sit as a pedestrian. speaking of which, when does it ever stop with supporting IE6, this bloody useless antiquated piece of crap - released in august 2001 - and still amounting to over 20% of all IE visits... basically - we encourage 'bad users' by trying to be too considerate instead of trying to educate and bring the standards up... and yes, i realise you cant waive off such a huge portion of your potential customers because they are too thick to upgrade their browser or tweak their settings. incidentally - in countries from eastern europe, IE6 users are representative of over 50% of all IE users - largely due to the fact that they tend to use illegal copies of windows and cannot upgrade... do i have sympathy? no.