Mobile app version of vmapp.org
Login or Join
Heady270

: 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.

@Heady270

Posted in: #Google #Javascript #Nofollow

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) ...

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Heady270

2 Comments

Sorted by latest first Latest Oldest Best

 

@Ogunnowo487

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/

10% popularity Vote Up Vote Down


 

@Karen161

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>

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme