Welcome to WebmasterWorld Guest from 54.162.44.105

Forum Moderators: incrediBILL & lawman

Message Too Old, No Replies

js code to number serps?

cool custom firefox button

     
9:37 pm on Apr 24, 2013 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Mar 7, 2003
posts: 1070
votes: 6


one of the marvelous WWM-izens once created this totally cool button thing that when pressed, put a number next to each serp result.

i thought I'd be able to find an email or note referring to the author, but that seems to have been several machines ago and lost to time.

the thing was slick, fast and always worked.

now it doesn't.

can I post the code here to see if anyone can revise for the new FF?

thanks as always!
9:49 pm on Apr 24, 2013 (gmt 0)

Senior Member from GB 

WebmasterWorld Senior Member brotherhood_of_lan is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Jan 30, 2002
posts:4861
votes: 11


You can run this from a javascript console, I tested it on a couple of SERP's and it worked OK.


var inc = 0;
var x = content.document.getElementsByClassName('r');
for(i in x)
x[i].innerHTML = (++inc)+'. '+x[i].innerHTML;


I guess whoever wrote the code you referred to made a plugin out of it, giving you the ease of clicking a button.
10:00 pm on Apr 24, 2013 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Mar 7, 2003
posts: 1070
votes: 6

I tried to cut and paste here what worked...

but it won't let me put it in... let me try that again - maybe disable codes?

[code]

javascript:var%20searchResults=document.getElementsByClassName('l');for%20(var%20i%20in%20searchResults)%20{var%20numberSpan%20=%20document.createElement('span');%20var%20resultNumber%20=%20document.createTextNode(((i-0)+1)+'.%20');numberSpan.appendChild(resultNumber);searchResults[i].parentNode.insertBefore(numberSpan,%20searchResults[i]);}

[/code]

err - consider me clueless on the fine points of the code.

how do I bolt what BoL into this?
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members