Bonjour
Voilà j’ai fait un script tous bete qui modifie sur une page web une image avec une map sur celles-ci. Le problème c’est que mon script passe impect sur Firefox mais sur IE je perds la map et seule l’image apparait. Voici le code :
function presentation(){
//Map
var amap;
var nmap;
var ar1;
var ar2;
var ar3;
var ar4;
var ar5;
var ar6;
amap=document.getElementById('zones');
nmap=document.createElement('map');
nmap.setAttribute('name','map1');
nmap.setAttribute('id','zones');
ar1=document.createElement('area');
ar1.setAttribute('alt','test1');
ar1.setAttribute('title','test1');
ar1.setAttribute('shape','rect');
ar1.setAttribute('coords','0,0,200,50');
ar2=document.createElement('area');
ar2.setAttribute('href','test2.html');
ar2.setAttribute('alt','test2');
ar2.setAttribute('title','test2');
ar2.setAttribute('shape','rect');
ar2.setAttribute('coords','0,50,100,100');
ar3=document.createElement('area');
ar3.setAttribute('href','test3.html');
ar3.setAttribute('alt','test3');
ar3.setAttribute('title','test3');
ar3.setAttribute('shape','rect');
ar3.setAttribute('coords','100,50,200,100');
ar4=document.createElement('area');
ar4.setAttribute('href','test4.html');
ar4.setAttribute('alt','test4');
ar4.setAttribute('title','test4');
ar4.setAttribute('shape','rect');
ar4.setAttribute('coords','0,100,100,150');
ar5=document.createElement('area');
ar5.setAttribute('href','test5.html');
ar5.setAttribute('alt','test5');
ar5.setAttribute('title','test5');
ar5.setAttribute('shape','rect');
ar5.setAttribute('coords','100,100,200,150');
ar6=document.createElement('area');
ar6.setAttribute('href','test6.html');
ar6.setAttribute('alt','test6');
ar6.setAttribute('title','test6');
ar6.setAttribute('shape','rect');
ar6.setAttribute('coords','0,0,200,200');
nmap.appendChild(ar1);
nmap.appendChild(ar2);
nmap.appendChild(ar3);
nmap.appendChild(ar4);
nmap.appendChild(ar5);
nmap.appendChild(ar6);
document.getElementById('confetti').replaceChild(nmap,amap);
//Image
var acouleur;
var ncouleur;
acouleur=document.getElementById('menu2');
ncouleur=document.createElement('img');
ncouleur.setAttribute('src','images/mpres.gif');
ncouleur.setAttribute('id','cadre');
ncouleur.setAttribute('alt','');
ncouleur.setAttribute('usemap','#map1');
ncouleur.setAttribute('border','0');
document.getElementById('confetti').replaceChild(ncouleur,acouleur);
}
Je comprends pas je vois pas ce que je fais de faux :neutre: . Quelqu’un pourrait il m’éclairer SVP