cs_davidedj
Messages postés1Date d'inscriptionmercredi 5 novembre 2003StatutMembreDernière intervention 5 novembre 2003
-
5 nov. 2003 à 21:07
francktfr
Messages postés101Date d'inscriptionvendredi 30 août 2002StatutMembreDernière intervention 5 novembre 2004
-
6 nov. 2003 à 09:14
Hello,
j'ai un petit probleme. Je connait pas du tout le javascript, et j'ai donc charché un script (SNARK :http://www.cs.cmu.edu/~jab/snark/) pour une search-machine pour placer sur mon site. Mon site est fait avec des frames et le probleme est que, quand je fait un submit il me ouvre la page dans mon frame de mon site, mais j'aimerais qu'il ce ouvre dans une nouvelle page d'explorer. Comment Faire????? HELP!!!!
Ici le script:
<SCRIPT>
<!-- hide this script from non-JavaScript browsers
// Distribution Rights Granted to: http://www.web-search.com/ // All code in this script is Copyright(C) 1996, Justin Boyan
// For documentation and more info, see: http://www.cs.cmu.edu/~jab/snark/ // This is SNARK Version 1.0, 18 May 1996
var MAX_ENGINES = 75;
var SNARK_STRING = "hunting+the+snark";
function MakeArray(n) {
for (var i = 1; i <= n; i++) {
this[i] = 0;
}
this.maxlen = n;
this.len = 0;
return this;
}
var engs = new MakeArray(MAX_ENGINES);
function find_substring(needle, haystack) { var i, needlen needle.length, haylen haystack.length;
for (i=0; i<=haylen-needlen; i++) {
if (needle == haystack.substring(i,i+needlen))
return i;
}
return false;
}
function HandleForm(form) {
form.submit(); // This fixes a mysterious Netscape bug. Without this line,
// you can't use <enter> to start the search the first time.
var i, oldq=form.query.value, newq="";
for (i=0; i<oldq.length; i++) { // compress [ ]+ into \+
var thischar = oldq.charAt(i);
if (thischar != ' ')
newq += thischar;
else if (lastchar != ' ')
newq += '+';
lastchar = thischar;
}
var eng = engs[1+form.service.selectedIndex];
location.href = newq ? eng.pre_snark + newq + eng.post_snark : eng.home;
}