Tengo un buscador en script, y lo que hace es buscar en una base de datos y habrir un popup con los resultados, anda perfecto pero lo que quisiera es que lo habra en un modo en que no se pueda seleccionar el texto.
Este es el script que quiero colocar dentro del código del buscador:
<script language="JavaScript1.2">
function disableselect(e){return false};
function reEnable(){return true}
document.onselectstart=new Function ("return false")
if (window.sidebar){document.onmousedown=disableselec t
document.onclick=reEnable};
</script>
Esta es una parte del codigo del buscador.
function SearchPage(i, sTargetUpper) { var j=-1, iElement; page[i][MatchElement]=-1;while( ++j <= Content && page[i][MatchElement]==-1 ) { iElement = j==0 ? Title : (j==1 ? Description : (j==2 ? URL : Content));if( ((iElement == Title ) && ( SearchTitle )) || ((iElement == Description ) && ( SearchDescription )) || ((iElement == URL ) && ( SearchURL )) || ((iElement == Content ) && ( SearchContent )) ) { SearchElement( i, iElement, sTargetUpper ); } else { page[i][MatchCount]=0 } if ( page[i][MatchCount] > 0 ) { page[i][MatchElement] = iElement; } } }
function WritePage( i, iMatched ) { sOutput += "<p><font face=\"Verdana\" size=\"2\" color=\"#C0C0C0\">" + iMatched +".</font> ";sOutput += "<a href=\""+page[i][URL]+"\"><font face=\"Verdana\" size=\"2\" color=\"#FFFFFF\">"+page[i][Title]+"</font></a>";if (( page[i][MatchElement]==Content ) && (SearchMode==0)) { WriteContentQuotes(i); } else { sOutput+=""; } if( (page[i][MatchElement]==Description ) && (SearchMode==0)) { sOutput += "<br><font face=\"Verdana\" size=\"2\" color=\"#008FFF\"> "; sOutput += "";WriteHighlighted( page[i][Description], page[i][MatchPosition] ); sOutput += "</font>"; } else { if( page[i][Description].length > 0 ) { sOutput += "<br><font face=\"Verdana\" size=\"2\" color=\"#008FFF\"></font><font face=\"Verdana\" size=\"2\" color=\"#008FFF\"> "; sOutput += "" + page[i][Description]; } else { } } sOutput += "</font>"; if( ShowQuoteCount ) { WriteMatchCount( i ); } sOutput += "<br>"; };
function WriteMatchedPages() { iMatched = 0;if (! (bWildcardError )) { for( var i=1; i<page.length; i++ ) { if(( page[page[i][SortPointer]][MatchCount] > 0 ) && (( iMatched < MaxResults ) || ( MaxResults == -1 ))) { WritePage(page[i][SortPointer], ++iMatched); } } } else { if( iWildcard == -4 ) { sOutput += "<BR><font face=\"Verdana\" size=\"2\" color=\"#FFFFFF\">ERROR (*): Debe ir un solo * y al final de lo tipeado.</font>"; } } }
function WriteDocTop() { sOutput += "<html><head><title>Buscando resultados... \"" + sOriginal + "\"</title>";
sOutput += "</head><body";
sOutput += " bgcolor=\"#000033\""; sOutput += ">";
sOutput += "<font face=\"Verdana\" size=\"3\" color=\"#FFFFFF\">";
sOutput += "<center><b>SABuscador</b><br>";
sOutput += "<font face=\"Verdana\" size=\"1\" color=\"#FFFFFF\">";
sOutput += "por: Sebastian Anibal Barreiro.</center>";
sOutput += "<font face=\"Verdana\" size=\"1\" color=\"#FFFFFF\">";
sOutput += "<p>Lo buscado fué: <b>" + sOriginal +".</b>";
sOutput += "</font></font></font>";}
function WriteDocEnd() { if(iMatched==0) { sOutput += "<p><font face=\"Verdana\" size=\"2\" color=\"#FFFFFF\">Lo buscado no se encontró en la base de datos SAB. "; } else { var sPlural = iMatched==1 ? "página encontrada." : "páginas encontradas.";
sOutput += "<p><font face=\"Verdana\" size=\"2\" color=\"#FFFFFF\">" + iMatched + " " + sPlural + " </font>"; }
sOutput += "<a href=\"javascript:window.close()\"><font face=\"Verdana\" size=\"2\">Cerrar.</font></a>";
sOutput += "</p></p></body></html>";}
function WriteHTML() { var sTempOutput = sOutput;hndlWindow = open("","Object", "resizable=yes,scrollbars=yes,toolbar=no,menubar=n o,location=no,directories=no,status=no,width=640,h eight=400");if ((navigator.appName.indexOf("Microsoft")!=-1) && (navigator.appVersion.indexOf("3.0")!=-1)) { alert("Click to see results"); } hndlWindow.document.open();hndlWindow.document.wri te( sTempOutput );hndlWindow.document.close(); }