Home » none » Highlite NoFollow in Internet Explorer

Highlite NoFollow in Internet Explorer

I don’t know why none of the toolbars that are available for Internet Explorer support this yet because it pretty stinkin’ easy to implement.  But, here you go…

One of the little know secrets of both Internet Explorer and FireFox is that you can run javascript from the address bar.  So, to get the nofollowed links to show with a red background, just paste this code into the address bar (all in one line):

javascript: var anchors;anchors = document.getElementsByTagName(“a”);var anchorIndex;for(anchorIndex = 0;anchorIndex < anchors.length;anchorIndex++) { if(anchors[anchorIndex].getAttribute(“rel”) && anchors[anchorIndex].getAttribute(“rel”)==”nofollow”) anchors[anchorIndex].style.backgroundColor=”red”;} void(0);

Now, I know what you’re thinking.

“There’s no way I’m going to copy and paste that code into the address bar every time I want to know if a site is implementing nofollow!”

Nope… and neither am I.  You see, you can activate the “Links” toolbar in Internet Explorer and add a shortcut that will do this automatically.  If you don’t have the Links toolbar active yet, just right click in the toolbar area of Internet Explorer and select “Links” from the menu.

Next, right click one of the links that are already there and select “Create Shortcut” from the menu.  This will create a new link button at the end of the toolbar.  Right click this new button and select “Properties” from the menu.

On the “General” tab, rename the button to “Show NoFollow”  or something else appropriate.  On the “Web Document” tab, copy and paste the code I gave you above into the URL field.

Now, whenever you want to see if no follow is being used on the page, just click the “Show NoFollow” button in the Links toolbar.

This script will display any nofollow links with a background color of red.  It will also only work if nofollow is the only value for the rel attribute.  This works most of the time because it normally IS the only value.

Like this Article? Subscribe to get every article sent to your email.

Related Post

  • Google NOFOLLOW Change (and why this isn’t news)Google NOFOLLOW Change (and why this isn’t news) Or, Chicken Little and rel=nofollow Google recently admitted they have changed the way they pass page rank to pages from a page that has the nofollow attribute attached to one or more […]
  • jQuery – EventsjQuery – Events As well as being able to change the class associated with an element or a set of elements on a screen, jQuery also allows you to fire events.  You might want to do this, for example, if […]
  • JavaScript ScopeJavaScript Scope If you’ve been programming in any other environment than JavaScript for a while, you may be making assumptions about JavaScript Scope that just aren’t true.  One of those […]
  • ASP.NET Response.Redirect() and JavaScriptASP.NET Response.Redirect() and JavaScript Yesterday we covered issues surrounding using ASP.NET's Response.Redirect in server side code. We noted that not handing it correctly could prevent code from running on the server that we […]
  • Does jQuery Make Us Lazy?Does jQuery Make Us Lazy? Yesterday I read a post that proposed that using jQuery as the answer to every JavaScript problem makes us lazy programmers. This is not what I was expecting to hear since the post was […]

About Dave Bush

Dave Bush is a Full Stack ASP.NET developer. His commitment to quality through test driven development, vast knowledge of C#, HTML, CSS and JavaScript as well as his ability to mentor younger programmers and his passion for Agile/Scrum as defined by the Agile Manifesto and the Scrum Alliance will certainly be an asset to your organization.

  • Stephen

    I’ve tried to use the script you posted, but its not working and I get a error in the bottom left corner of the browser each time I try to use it.

    Can you email or post more instructions?

  • Dave

    Sorry, the double quotes seem to be getting “prettified” by WordPress. If you look closely, they are ending quote marks instead of boring code double quote marks. Fix that up and it will work.