Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I would like to create a share link to my website using javascript:

script src="[url-to-my-script]"

Basically the main idea behind this is to render HTML block with an image and link to the website.

By using JavaScript approach I can control the look and feel of that link + potentially I could change the link html in the future without touching partner websites.

The only potential problem I see with this approach is SEO. I'm not sure if google will be able to index that link to my website, since it's generated by javascript.

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Search engines don't read dynamic content produced by JavaScript so even if your JavaScript code produces HTML with a link to your site in it the search engines will not know about it.

Your best solution is to use a NOSCRIPT tag to include some HTML which links to your site.

share|improve this answer

Like John said, there would not be any direct SEO benefit - i.e. those links would not increase your PageRank - but you you'd still get your name out there and get more visitors (isn't that what it's all about?)

Regardless, I think other webmasters might be wary of using an external Javascript file just to link to a web site. If it's a more intricate widget (say, your latest news) then you may get more traction, but the user must put their faith in you that you won't change the script to take over their web page or something else sinister.

You could either go with a standard text link, or perhaps a dynamically-generated image. Alternatively, try one of the common sharing widgets like AddThis, which allows sharing over the various social networks.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.