For those of you who don't want to make your Firefox search add-on list any longer, or don't even use Firefox, you can drag this link to your bookmarks toolbar, select some text on a web site, click the bookmark and be taken in a new window/tab to WorldCat results. It is a hack, but can be easily refined in a number of ways, if one wished. It works for me the way it is, with one little problem: selected text in a form field (and probably within flash content) can't be used as fodder for the search.
Here is the code:
javascript:(
function%20getSelText(){
var%20txt='';
if(window.getSelection){
txt=window.getSelection();
}
else%20if(document.selection){
txt=document.selection.createRange().text;
}
else{
return;
}
newSearch=window.open(%22http://www.worldcat.org/search?q=%22+txt);
}
)();
function%20getSelText(){
var%20txt='';
if(window.getSelection){
txt=window.getSelection();
}
else%20if(document.selection){
txt=document.selection.createRange().text;
}
else{
return;
}
newSearch=window.open(%22http://www.worldcat.org/search?q=%22+txt);
}
)();