Bonjour,

J'utilise Prototype et Script.aculo.us pour diverses raisons mais avant tout pour la gestion de l'autocompletion au fur et à mesure de la frappe et l'autorefresh de certains éléments de mon forum.

Cependant, en regardant les logs apache, j'ai constaté un nombre d'erreur 404 incroyable depuis l'implémentation de Prototype et Script.aculo.us

Voici un exemple d'erreur :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
[Fri Nov 05 03:07:18 2010] [error] [client xx.xx.xx.xx] (20024)The given path is misformatted or contained invalid characters: access to /img/smilies/function (_60) {    var _61 = [];    this.each(function (_62, _63) {_61.push((_60 || Prototype.K)(_62, _63));});    return _61;} failed
[Fri Nov 05 03:07:18 2010] [error] [client xx.xx.xx.xx] File does not exist: /img/smilies/function (_64) {    var _65;    this.each(function (_66, _67) {if (_64(_66, _67)) {_65 = _66;throw $break;}});    return _65;}
[Fri Nov 05 03:07:19 2010] [error] [client xx.xx.xx.xx] File does not exist: /img/smilies/function (_68) {    var _69 = [];    this.each(function (_6a, _6b) {if (_68(_6a, _6b)) {_69.push(_6a);}});    return _69;}
[Fri Nov 05 03:07:19 2010] [error] [client xx.xx.xx.xx] (20024)The given path is misformatted or contained invalid characters: access to /img/smilies/function (_6c, _6d) {    var _6e = [];    this.each(function (_6f, _70) {var _71 = _6f.toString();if (_71.match(_6c)) {_6e.push((_6d || Prototype.K)(_6f, _70));}});    return _6e;} failed
Ce genre de messages n'apparait que lorsque deux conditions sont réunis.
1-Prototype et Script.aculo.us sont appelés
2-Une autre fonction javascript est appelée

L'autre fonction en question est tb.barSmilies(smilies); qui fait partie d'un script un peu plus grand...
Cette fonction affiche une barre remplie des premiers smileys disponibles.
Le script en question est le suivant :
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
/***********************************************************************
 
  Copyright (C) 2010 Mpok
  based on code Copyright (C) 2006 Vincent Garnier
  based on code Copyright (c) 2004 Olivier Meunier and contributors
  License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
 
************************************************************************/
 
function toolBar(textarea, bt_img_path, smilies_img_path)
{
	if (!document.createElement)
		return;
 
	if ((typeof(document['selection']) == 'undefined')
	&& (typeof(textarea['setSelectionRange']) == 'undefined'))
		return;
 
	var toolbar = document.createElement('div');
	toolbar.id = 'toolbar';
	toolbar.style.padding = '4px 0';
 
	var smilies = document.createElement('div');
	smilies.id = 'smilies';
	smilies.style.display = 'none';
	smilies.style.padding = '0.3em 0';
 
	function addButton(src, title, fn)
	{
		var i = document.createElement('img');
		i.src = bt_img_path + src;
		i.title = title.replace(/& quot;/g, '"');
		i.style.padding = '0 5px 0 0';
		i.onclick = function() { try { fn() } catch (e) { } return false };
		i.tabIndex = 400;
		toolbar.appendChild(i);
	}
 
	function addSmiley(src, txt)
	{
		var i = document.createElement('img');
		var htxt = txt;
		htxt = htxt.replace(new RegExp(/& amp;/g), '&');
		htxt = htxt.replace(new RegExp(/& quot;/g), '"');
		htxt = htxt.replace(new RegExp(/& lt;/g), '<');
		htxt = htxt.replace(new RegExp(/& gt;/g), '>');
		i.src = smilies_img_path + src;
		i.title = txt;
		i.style.verticalAlign = 'middle';
		i.style.padding = '0 5px 0 0';
		i.onclick = function() { try { encloseSelection(htxt, '') } catch (e) { } return false };
		i.tabIndex = 400;
		smilies.appendChild(i);
	}
 
	function addSpace(w)
	{
		var s = document.createElement('span');
		s.style.padding = '0 ' + w + 'px 0 0';
		s.appendChild(document.createTextNode(' '));
		toolbar.appendChild(s);
	}
 
	function encloseSelection(prefix, suffix, fn)
	{
		textarea.focus();
		var start, end, sel, scrollPos, subst;
 
		if (typeof(document['selection']) != 'undefined')
			sel = document.selection.createRange().text;
		else if (typeof(textarea['setSelectionRange']) != 'undefined')
		{
			start = textarea.selectionStart;
			end = textarea.selectionEnd;
			scrollPos = textarea.scrollTop;
			sel = textarea.value.substring(start, end);
		}
 
		if (sel.match(/ $/))
		{
			// exclude ending space char, if any
			sel = sel.substring(0, sel.length - 1);
			suffix = suffix + " ";
		}
 
		if (typeof(fn) == 'function')
			var res = (sel) ? fn(sel) : fn('');
		else
			var res = (sel) ? sel : '';
 
		subst = prefix + res + suffix;
 
		if (typeof(document['selection']) != 'undefined')
		{
			var range = document.selection.createRange().text = subst;
			textarea.caretPos -= suffix.length;
		}
		else if (typeof(textarea['setSelectionRange']) != 'undefined')
		{
			textarea.value = textarea.value.substring(0, start) + subst + textarea.value.substring(end);
			if (sel)
				textarea.setSelectionRange(start + subst.length, start + subst.length);
			else
				textarea.setSelectionRange(start + prefix.length, start + prefix.length);
			textarea.scrollTop = scrollPos;
		}
	}
 
	function draw()
	{
		textarea.parentNode.insertBefore(smilies, textarea);
		textarea.parentNode.insertBefore(toolbar, textarea);
	}
 
	function singleTag(tag)
	{
		var stag = '[' + tag + ']';
		var etag = '[/' + tag + ']';
		encloseSelection(stag, etag);
	}
 
	function btSingle(img, tag, label)
	{
		addButton(img, label, function() { singleTag(tag) });
	}
 
	function btPrompt_1(img, tag, label, msg_1)
	{
		addButton(img, label,
			function() {
				encloseSelection('', '',
					function(str) {
						var var_1 = window.prompt(msg_1, '');
						if (!var_1)
							return '[' + tag + ']' + str + '[/' + tag + ']';
						else
							return '[' + tag + '=' + var_1 + ']' + str + '[/' + tag +']';
					});
			});
	}
 
	function btPrompt_1inside(img, tag, label, msg_1)
	{
		addButton(img, label,
			function() {
				encloseSelection('', '',
					function(str) {
						var var_1 = window.prompt(msg_1, '');
						if (!var_1)
							return str;
						else
							return '[' + tag + ']' + var_1 + '[/' + tag + ']';
					});
			});
	}
 
	function btPrompt_2(img, tag, label, msg_1, msg_2, reverse)
	{
		addButton(img, label,
			function() {
				encloseSelection('', '',
					function(str) {
						var var_1 = window.prompt(msg_1, '');
						if (!var_1)
							return str;
						var var_2 = window.prompt(msg_2, str);
						if (var_2)
						{
							if (reverse)
								return '[' + tag + '=' + var_2 + ']' + var_1 + '[/' + tag +']';
							else
								return '[' + tag + '=' + var_1 + ']' + var_2 + '[/' + tag +']';
						}
						else
							return '[' + tag + ']' + var_1 + '[/' + tag + ']';
					});
			});
	}
 
	function btColor(img, label)
	{
		addButton(img, label,
			function() {
				document.getElementById('req_message').focus();
				var width = 380;
				var height = 240;
				window.open('color_picker.php', 'cp', 'alwaysRaised=yes, dependent=yes, resizable=no, location=no, width=' + width + ', height=' + height + ', menubar=no, status=yes, scrollbars=no, menubar=no');
			});
	}
 
	function btSmilies(img, label)
	{
		addButton(img, label,
			function() {
				var element = document.getElementById('smilies');
				if (element.style.display == 'block' )
				{
					textarea.focus();
					element.style.display = 'none';
				}
				else
				{
					textarea.focus();
					element.style.display = 'block';
				}
			});
	}
 
	function moreSmilies(txt)
	{
		var l = document.createElement('span');
		l.style.padding = '1em';
		l.style.cursor = 'pointer';
		l.onclick = function() { popup_smilies() };
		l.appendChild(document.createTextNode(txt));
		smilies.appendChild(l);
	}
 
	function barSmilies(smilies)
	{
		for (var codem in smilies)
			addSmiley(smilies[codem], codem);
	}
 
	// Methods
	this.addButton		= addButton;
	this.addSmiley		= addSmiley;
	this.addSpace		= addSpace;
	this.draw		= draw;
	this.btSingle		= btSingle;
	this.btPrompt_1		= btPrompt_1;
	this.btPrompt_1inside	= btPrompt_1inside;
	this.btPrompt_2		= btPrompt_2;
	this.btColor		= btColor;
	this.btSmilies		= btSmilies;
	this.moreSmilies	= moreSmilies;
	this.barSmilies		= barSmilies;
}
Le gros problème, c'est que j'ai beau chercher encore et encore, je ne comprends pas pourquoi les erreurs apparaissent et encore moins comment corriger cela.

Pourriez-vous m'aider s'il vous plait ?
Merci d'avance


EDIT :
Les & quot; et compagnie ont été transformés par le parseur de ce forum...J'ai donc ajouté un espace