codice:
var w_2 = null;
function visualizza_immagine_mappa()
{
viewerFrame = self.parent.parent;
map = self.viewerFrame.mapFrame;
if(map && map.document.getElementById("mapImage1"))
{
var url = map.document.getElementById("mapImage1").src
document.getElementById("TextArea1").value = url;
if (w_2 != null && w_2.open) w_2.close();
w_2 = window.open("", "foto2", "width=1000px,height=800px,top=0px,left=0px,resizable=yes,scrollbars=yes,menubar=yes,toolbar=yes,location=yes");
d = w_2.document;
d.writeln("<h"+"tml>");
d.writeln("<h"+"ead>");
d.writeln("<t"+"itle>" + "" + "</t"+"itle>");
d.writeln( "</h"+"ead>" );
d.writeln( "<b"+"ody >" );
//d.writeln( format('[img]{0}[/img]', url) );
d.writeln('[img]' + url + '[/img]');
d.writeln( "</b"+"ody>" );
d.writeln( "</h"+"tml>" );
d.close();
if(w_2) w_2.focus();
}
}
questo codice, che funziona con IE, Firefox e Opera, crea un popup, scrive con document.writeln tutto l'html e mi visualizza una immagine.
Come detto non va con Chrome.
L'html prodotto è:
codice:
<html><head>
<title></title>
</head>
<body>
[img][/img]
</body></html>
cosa sbaglio?
ciao