salut;
j'avoue que je ne sais toujours pas où poster ce problème mais bon comme c'est d'abord du JS...
alors voilà, j'ai un moteur de recherche (que j'ai trouvé sur le net) qui marche très bien sous windows mais pas sous linux! je ne comprends pas pourquoi !
voici le code
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<script language="JavaScript">
var MAX_ENGINES = 30;
var SNARK_STRING = "officiel+net";
 
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 Engine(name, opts, home, search) {
var snark = find_substring(SNARK_STRING, search);
this.name = name;
this.opts = opts;
this.home = home;
this.pre_snark = search.substring(0,snark);
this.post_snark= search.substring(snark+SNARK_STRING.length, search.length);
}
 
function Add(name, opts, home, search) {
engs.len++;
if (engs.len <= engs.maxlen) {
engs[engs.len] = new Engine(name, opts, home, search)
}
else {
alert("Better increase MAX_ENGINES: " + engs.len + ">" + engs.maxlen)
}
}
 
 
Add("AltaVista", "SELECTED",
"http://altavista.com/",
"http://altavista.com/web/results?pg=q&what=web&fmt=d&q=officiel+net" );
 
Add("Yahoo!", "",
"http://www.yahoo.com/",
"http://search.yahoo.com/bin/search?p=officiel+net" );
 
Add("Google", "SELECTED",
"http://www.google.com/",
"http://www.google.fr/search?q=officiel+net" );
A9phonie+mobile&ie=UTF-8&hl=fr&meta=
function HandleForm(form) {
form.submit(); 
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;
}
 
function DisplayForm() {
document.writeln('<div style="position:absolute;top:60px;left:540px;"><FORM OnSubmit="HandleForm(this); return false">');
document.writeln('Avec <SELECT name="service">');
for (i=1; i <= engs.len; i++) {
document.writeln("<OPTION " + engs[i].opts + "> " + engs[i].name);
}
document.writeln('</SELECT> rechercher <INPUT size=26 name="query">');
document.writeln('<input type=submit value=" GO!">');
document.writeln('</FORM> </div>');
}
 
DisplayForm();
 
</script>
désolée d'avoir mis tout le code, mais je n'arrive pas à localiser le problème (vu que je suis nulle en JS)
merci à tous