Code : Tout sélectionner
//if there is no content (other than formatting) set value to nothing
if (stripHTML(oHdnMessage.value.replace(" ", " ")) == ""
&& oHdnMessage.value.toLowerCase().search("<hr") == -1
&& oHdnMessage.value.toLowerCase().search("<img") == -1) oHdnMessage.value = "";<script language='JavaScript' type='text/javascript'>
var aNameValuePair = location.search.substring(1,location.search.length).split("&");
var aParam = new Array(aNameValuePair.length);
for ( var i=0; i<aNameValuePair.length; i++ ) {
param = aNameValuePair[i].split("=");
aParam[param[0]] = aParam[i] = { name: param[0], value: unescape(param[1].replace('+', ' ')) };
}
language = aParam[0].value;
rte = aParam[1].value;
function insertSmiley(img) {
if (img) {
window.opener.document.getElementById(rte).contentWindow.focus();
window.opener.document.getElementById(rte).contentWindow.document.execCommand('InsertImage', false, img);
window.close();
}
}
function InitArray() {
if (document.getElementsByTagName)
var x = document.getElementsByTagName('TD');
else if (document.all)
var x = document.all.tags('TD');
for (var i=0;i<x.length;i++) {
x[i].onmouseover = over;
x[i].onmouseout = out;
}
}
function over() {
this.style.border='1px dotted white';
}
function out() {
this.style.border='1px solid gray';
}
</script>
Donc en fait moi ce que je cherche à faire c'est rajouter l'attribut alt="" et si possible fermer la balise <img />, si quelqu'un pouvait m'expliquer ou me donner quelques pistes.Code : Tout sélectionner
function insertSmiley(img) {
if (img) {
window.opener.document.getElementById(rte).contentWindow.focus();
window.opener.document.getElementById(rte).contentWindow.document.execCommand('InsertImage', false, img);
window.close();
}
}
Code : Tout sélectionner
http://.../monImage.gif" alt="mon altCode : Tout sélectionner
var str = '<img src="'+document.fomulaire.champSrc.vlaue+'" alt="'+document.fomulaire.champAlt.vlaue+'">'