: What is the syntax for putting a nofollow attribute into a javascript file Matt Cutts states in this video: It turns out that as we are executing JavaScript, we do look at the attributes.
Matt Cutts states in this video:
It turns out that as we are executing JavaScript, we do look at the attributes. So you can actually use Javascript and put, like, a nofollow attribute on individual URLs.
I'm not clear to me what the syntax for that would be. How would I put a nofollow on a link in a variable like this?
var mylink = "http://example.com/";
or if it in AJAX like this?
$.ajax({
type: 'post',
url: '/path/ajax-handler/' + method,
success: function(data) ...
More posts by @Heady270
2 Comments
Sorted by latest first Latest Oldest Best
There is no attribute "rel" in <script>, therefore the following code will produce a validation error in your CSS:
<script rel="nofollow" src="/js/code.js"></script>
Does Google follow JavaScript links? Yes. www.adherewebdesign.com/experiment/results/
Possible solution:
Edit robots.txt to include the following line:
User-agent: * Disallow: offending-java-url.com
This will stop all bots from following the java link.
Also,
You can verify your CSS validation here: validator.w3.org/
What he is referring to is the HTML markup of the page. The nofollow keyword goes into a rel attribute on a tag, usually an <a> tag with an href like so: <a href="/link" rel="nofollow">link</a>. So he is suggesting that if you don't want search engines parsing through your javascript and looking for links you can do this:
<script rel="nofollow" src="/js/code.js"></script>
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.