11548 sujets

JavaScript, DOM et API Web HTML5

Bonjour,
J'ai utilisé le script suivant pour créer des pop-up à la volée et s'adaptant aux dimensions de l'image chargée; ça marche tres bien en html par contre
dés que je passe ma page en ASP, il y a l'erreur suivante:


a écrit :
Nested Script Block :
A script block cannot be placed inside another script block.


Mon code JS
function PopupImage(img) {
titre="Agrandissement";
w=open("",'image','width=600,height=600,toolbar=no,scrollbars=yes,resizable=yes,menubar=yes, top=0,left=0');
w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE>");
w.document.write("<script type=text/javascript>function checksize() { if (document.images[0].complete) { window.resizeTo(document.images[0].width+30,document.images[0].height+85); window.focus();} else { setTimeout('checksize()',250) } }</script>");
w.document.write("</head>");
w.document.write("<BODY onload='checksize()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0>");
w.document.write("<TABLE width='100%' border='0' cellspacing='0' cellpadding='0' height='100%'><TR>");
w.document.write("<TD valign='middle' align='center'><IMG src='"+img+"' border=0 alt='Mon image'>");
w.document.write("</TD></TR></TABLE>");
w.document.write("</BODY></HTML>");
w.document.close();
}


Comment est ce que je peux m'en demerder?
Modifié par Hermann (24 Jan 2006 - 23:23)