3 ms·
Neither of those sites seem to be available though. The code below that comment is - var NS = (navigator.appName == "Netscape") ? 1 : 0; if (NS) document.
by thunderbong 6y ago
Neither of those sites seem to be available though.
The code below that comment is -
var NS = (navigator.appName == "Netscape") ? 1 : 0;
if (NS) document.captureEvents(Event.DBLCLICK);
document.ondblclick = dict;
var newwin;
function dict() {
if (NS) {
t = document.getSelection();
opennewwin(t);
}
else {
t = document.selection.createRange();
if(document.selection.type == 'Text' && t.text != '') {
document.selection.empty();
opennewwin(t.text);
}
}
}
function opennewwin(text) {
if (text > '') {
newwin = window.open('http://en.wikipedia.org/wiki/Special:Search?search='+text, 's&go=Go');
setTimeout('newwin.focus()', 100);
}
}
- mikepurvis 6y agoWell yes, I assumed that anyone interested in the actual implementation could go view-source it for themselves. Obviously this was cut-and-pasted into this website's generic footer many, many moons ago, and the fact that it remains long after the original source is gone is part of the charm.