homepage Welcome to WebmasterWorld Guest from 54.237.98.229
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Local / Foo
Forum Library, Charter, Moderators: incrediBILL & lawman

Foo Forum

    
js code to number serps?
cool custom firefox button
chewy

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 4567687 posted 9:37 pm on Apr 24, 2013 (gmt 0)

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!

 

brotherhood of LAN

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



 
Msg#: 4567687 posted 9:49 pm on Apr 24, 2013 (gmt 0)

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.

chewy

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 4567687 posted 10:00 pm on Apr 24, 2013 (gmt 0)
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?
Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Local / Foo
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved