la prochaine fois qu’on se voit, vous m’
une UPSA … paske le genre de code
// Define document.getElementById for Internet Explorer 4.
4if (typeof(document.getElementById) == "undefined")
5 document.getElementById = function (id)
6 {
7 // Just return the corresponding index of all.
8 return document.all[id];
9 }
10// Define XMLHttpRequest for IE 5 and above. (don't bother for IE 4 :/.... works in Opera 7.6 and Safari 1.2!)
11else if (!window.XMLHttpRequest && window.ActiveXObject)
12 window.XMLHttpRequest = function ()
13 {
14 return new ActiveXObject(navigator.userAgent.indexOf("MSIE 5") != -1 ? "Microsoft.XMLHTTP" : "MSXML2.XMLHTTP");
15 };
16
17// Some older versions of Mozilla don't have this, for some reason.
18if (typeof(document.forms) == "undefined")
19 document.forms = document.getElementsByTagName("form");
et autres
function replaceText(text, textarea)
115{
116 // Attempt to create a text range (IE).
117 if (typeof(textarea.caretPos) != "undefined" && textarea.createTextRange)
118 {
119 var caretPos = textarea.caretPos;
120
121 caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
122 caretPos.select();
123 }
124 // Mozilla text range replace.
125 else if (typeof(textarea.selectionStart) != "undefined")
126 {
127 var begin = textarea.value.substr(0, textarea.selectionStart);
128 var end = textarea.value.substr(textarea.selectionEnd);
129 var scrollPos = textarea.scrollTop;
130
131 textarea.value = begin + text + end;
132
133 if (textarea.setSelectionRange)
134 {
135 textarea.focus();
ça me :ordi1: :marteau:
me suis souvenu de pourquoi j’étais pas allé plus loin :bang: