- Home
- Categorie
- Coding e Sistemistica
- HTML e CSS
- save as firefox
-
save as firefox
ciao a tutti, vi posto il mio programma per salvare dei log di testo, in explorer va tutto ok, ma in firefox nn va, e con la consol mi da errore qua...
document.body.insertBefore( w );qualcuno sa il perchè, io ormai non ci capisco più niente.
grazie[html]<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Messages Log</title>
<style type="text/css">
body {
background-color: #FFCC33;
}
a:active { text-decoration: none}
a:hover { color: #FF3333; text-decoration: underline}
a:link { color: #3333FF; text-decoration: none}
a:visited { text-decoration: none}
.Stile1 {font-size: 30px; color: #FF6600;}
.Stile2 {color:}
</style>
<script type="text/javascript">
function savefile(f) {
f = f.elements;
var w = window.frames.w;
if( !w ) {
w = document.createElement( 'iframe' );
w.id = 'w';
w.style.display = 'none';
document.body.insertBefore( w );
w = window.frames.w;
if( !w ) {
w = window.open( '', '_temp', 'width=100,height=100' );
if( !w ) {
window.alert( 'Sorry, could not create file.' ); return false;
}
}
}
var d = w.document,
ext = f.ext.options[f.ext.selectedIndex],
name = f.filename.value.replace( ///g, '\' ) + ext.text;
d.open( 'text/plain', 'replace' );
d.charset = ext.value;
ext.text==='.txt';
d.writeln( f.sLOG_MSG_01.value );
d.writeln( f.sLOG_MSG_02.value );
d.writeln( f.sLOG_MSG_03.value );
d.writeln( f.sLOG_MSG_04.value );
d.writeln( f.sLOG_MSG_05.value );
d.writeln( f.sLOG_MSG_06.value );
d.writeln( f.sLOG_MSG_07.value );
d.writeln( f.sLOG_MSG_08.value );
d.writeln( f.sLOG_MSG_09.value );
d.writeln( f.sLOG_MSG_10.value );
d.writeln( f.sLOG_MSG_11.value );
d.writeln( f.sLOG_MSG_12.value );
d.writeln( f.sLOG_MSG_13.value );
d.writeln( f.sLOG_MSG_14.value );
d.writeln( f.sLOG_MSG_15.value );
d.writeln( f.sLOG_MSG_16.value );
d.writeln( f.sLOG_MSG_17.value );
d.writeln( f.sLOG_MSG_18.value );
d.writeln( f.sLOG_MSG_19.value );
d.writeln( f.sLOG_MSG_20.value );
d.writeln( f.sLOG_MSG_21.value );
d.writeln( f.sLOG_MSG_22.value );
d.writeln( f.sLOG_MSG_23.value );
d.writeln( f.sLOG_MSG_24.value );
d.writeln( f.sLOG_MSG_25.value );
d.writeln( f.sLOG_MSG_26.value );
d.writeln( f.sLOG_MSG_27.value );
d.writeln( f.sLOG_MSG_28.value );
d.writeln( f.sLOG_MSG_29.value );
d.writeln( f.sLOG_MSG_30.value );
d.close();if( d.execCommand( 'SaveAs', null, name ) ){
window.alert( name + ' has been saved.' );
} else {
window.alert( 'The file has not been saved.\nIs there a problem?' );
}
w.close();
return false; // don't submit the form
}
</script>
</head>
<body>
<div align="center">
<p align="center" class="Stile1">User Messages Log</p>
</div>
<form name="log" method=get action="/cgi-bin/log.cgi">
<table width="748" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="740" border="0">
<TABLE BORDER="1" width="671" cellpadding="0" cellspacing="0" align="center">
<font size="3">
<TR bgcolor="#FFFF66">
<TH width="42"><div align="center"><font size="3" color="#FF6600" >LOG</font></div></TH>
<TH width="610"><div align="center"><font size="3" color="#FF6600" >MESSAGE</font></div></TH>
</TR>
</font>
<TR ALIGN="center" bgcolor="#FFFFFF">
<TD bgcolor="#FFFF66"><font size="3"><span class="Stile2">01</span></font></TD>
<TD><font size="3">
<input type="text" name="sLOG_MSG_01" size="100" value="<!--#echo var="sLOG_MSG_01"-->
"></font></TD>
</TR>
<TR ALIGN="center" bgcolor="#FFFFFF">
<TD bgcolor="#FFFF66"><font size="3"><span class="Stile2">02</span></font></TD>
<TD><font size="3">
<input type="text" name="sLOG_MSG_02" size="100" value="<!--#echo var="sLOG_MSG_02"-->
"></font></TD>
</TR>
<TR ALIGN="center" bgcolor="#FFFFFF">
<TD bgcolor="#FFFF66"><font size="3"><span class="Stile2">03</span></font></TD>
<TD><font size="3">
<input type="text" name="sLOG_MSG_03" size="100" value="<!--#echo var="sLOG_MSG_03"-->
"></font></TD>
</TR>
<TR ALIGN="center" bgcolor="#FFFFFF">
<TD bgcolor="#FFFF66"><font size="3"><span class="Stile2">04</span></font></TD>
<TD><font size="3">
<input type="text" name="sLOG_MSG_04" size="100" value="<!--#echo var="sLOG_MSG_04"-->
"></font></TD>
</TR>
<TR ALIGN="center" bgcolor="#FFFFFF">
<TD bgcolor="#FFFF66"><font size="3"><span class="Stile2">05</span></font></TD>
<TD><font size="3">
<input type="text" name="sLOG_MSG_05" size="100" value="<!--#echo var="sLOG_MSG_05"-->
"></font></TD>
</TR>
<TR ALIGN="center" bgcolor="#FFFFFF">
<TD bgcolor="#FFFF66"><font size="3"><span class="Stile2">06</span></font></TD>
<TD><font size="3">
<input type="text" name="sLOG_MSG_06" size="100" value="<!--#echo var="sLOG_MSG_06"-->
"></font></TD>
</TR>
<TR ALIGN="center" bgcolor="#FFFFFF">
<TD bgcolor="#FFFF66"><font size="3"><span class="Stile2">07</span></font></TD>
<TD><font size="3">
<input type="text" name="sLOG_MSG_07" size="100" value="<!--#echo var="sLOG_MSG_07"-->
"></font></TD>
</TR>
<TR ALIGN="center" bgcolor="#FFFFFF">
<TD bgcolor="#FFFF66"><font size="3"><span class="Stile2">08</span></font></TD>
<TD><font size="3">
<input type="text" name="sLOG_MSG_08" size="100" value="<!--#echo var="sLOG_MSG_08"-->
"></font></TD>
</TR>
<TR ALIGN="center" bgcolor="#FFFFFF">
<TD bgcolor="#FFFF66"><font size="3"><span class="Stile2">09</span></font></TD>
<TD><font size="3">
<input type="text" name="sLOG_MSG_09" size="100" value="<!--#echo var="sLOG_MSG_09"-->
"></font></TD>
</TR>
<TR ALIGN="center" bgcolor="#FFFFFF">
<TD bgcolor="#FFFF66"><font size="3"><span class="Stile2">10</span></font></TD>
<TD><font size="3">
<input type="text" name="sLOG_MSG_10" size="100" value="<!--#echo var="sLOG_MSG_10"-->
"></font></TD>
</TR>
<TR ALIGN="center" bgcolor="#FFFFFF">
<TD bgcolor="#FFFF66"><font size="3"><span class="Stile2">11</span></font></TD>
<TD><font size="3">
<input type="text" name="sLOG_MSG_11" size="100" value="<!--#echo var="sLOG_MSG_11"-->
"></font></TD>
</TR>
<TR ALIGN="center" bgcolor="#FFFFFF">
<TD bgcolor="#FFFF66"><font size="3"><span class="Stile2">12</span></font></TD>
<TD><font size="3">
<input type="text" name="sLOG_MSG_12" size="100" value="<!--#echo var="sLOG_MSG_12"-->
"></font></TD>
</TR>
<TR ALIGN="center" bgcolor="#FFFFFF">
<TD bgcolor="#FFFF66"><font size="3"><span class="Stile2">13</span></font></TD>
<TD><font size="3">
<input type="text" name="sLOG_MSG_13" size="100" value="<!--#echo var="sLOG_MSG_13"-->
"></font></TD>
</TR>
<TR ALIGN="center" bgcolor="#FFFFFF">
<TD bgcolor="#FFFF66"><font size="3"><span class="Stile2">14</span></font></TD>
<TD><font size="3">
<input type="text" name="sLOG_MSG_14" size="100" value="<!--#echo var="sLOG_MSG_14"-->
"></font></TD>
</TR>
<TR ALIGN="center" bgcolor="#FFFFFF">
<TD bgcolor="#FFFF66"><font size="3"><span class="Stile2">15</span></font></TD>
<TD><font size="3">
<input type="text" name="sLOG_MSG_15" size="100" value="<!--#echo var="sLOG_MSG_15"-->
"></font></TD>
</TR>
<TR ALIGN="center" bgcolor="#FFFFFF">
<TD bgcolor="#FFFF66"><font size="3"><span class="Stile2">16</span></font></TD>
<TD><font size="3">
<input type="text" name="sLOG_MSG_16" size="100" value="<!--#echo var="sLOG_MSG_16"-->
"></font></TD>
</TR>
<TR ALIGN="center" bgcolor="#FFFFFF">
<TD bgcolor="#FFFF66"><font size="3"><span class="Stile2">17</span></font></TD>
<TD><font size="3">
<input type="text" name="sLOG_MSG_17" size="100" value="<!--#echo var="sLOG_MSG_17"-->
"></font></TD>
</TR>
<TR ALIGN="center" bgcolor="#FFFFFF">
<TD bgcolor="#FFFF66"><font size="3"><span class="Stile2">18</span></font></TD>
<TD><font size="3">
<input type="text" name="sLOG_MSG_18" size="100" value="<!--#echo var="sLOG_MSG_18"-->
"></font></TD>
</TR>
<TR ALIGN="center" bgcolor="#FFFFFF">
<TD bgcolor="#FFFF66"><font size="3"><span class="Stile2">19</span></font></TD>
<TD><font size="3">
<input type="text" name="sLOG_MSG_19" size="100" value="<!--#echo var="sLOG_MSG_19"-->
"></font></TD>
</TR>
<TR ALIGN="center" bgcolor="#FFFFFF">
<TD bgcolor="#FFFF66"><font size="3"><span class="Stile2">20</span></font></TD>
<TD><font size="3">
<input type="text" name="sLOG_MSG_20" size="100" value="<!--#echo var="sLOG_MSG_20"-->
"></font></TD>
</TR>
<TR ALIGN="center" bgcolor="#FFFFFF">
<TD bgcolor="#FFFF66"><font size="3"><span class="Stile2">21</span></font></TD>
<TD><font size="3">
<input type="text" name="sLOG_MSG_21" size="100" value="<!--#echo var="sLOG_MSG_21"-->
"></font></TD>
</TR>
<TR ALIGN="center" bgcolor="#FFFFFF">
<TD bgcolor="#FFFF66"><font size="3"><span class="Stile2">22</span></font></TD>
<TD><font size="3">
<input type="text" name="sLOG_MSG_22" size="100" value="<!--#echo var="sLOG_MSG_22"-->
"></font></TD>
</TR>
<TR ALIGN="center" bgcolor="#FFFFFF">
<TD bgcolor="#FFFF66"><font size="3"><span class="Stile2">23</span></font></TD>
<TD><font size="3">
<input type="text" name="sLOG_MSG_23" size="100" value="<!--#echo var="sLOG_MSG_23"-->
"></font></TD>
</TR>
<TR ALIGN="center" bgcolor="#FFFFFF">
<TD bgcolor="#FFFF66"><font size="3"><span class="Stile2">24</span></font></TD>
<TD><font size="3">
<input type="text" name="sLOG_MSG_24" size="100" value="<!--#echo var="sLOG_MSG_24"-->
"></font></TD>
</TR>
<TR ALIGN="center" bgcolor="#FFFFFF">
<TD bgcolor="#FFFF66"><font size="3"><span class="Stile2">25</span></font></TD>
<TD><font size="3">
<input type="text" name="sLOG_MSG_25" size="100" value="<!--#echo var="sLOG_MSG_25"-->
"></font></TD>
</TR>
<TR ALIGN="center" bgcolor="#FFFFFF">
<TD bgcolor="#FFFF66"><font size="3"><span class="Stile2">26</span></font></TD>
<TD><font size="3">
<input type="text" name="sLOG_MSG_26" size="100" value="<!--#echo var="sLOG_MSG_26"-->
"></font></TD>
</TR>
<TR ALIGN="center" bgcolor="#FFFFFF">
<TD bgcolor="#FFFF66"><font size="3"><span class="Stile2">27</span></font></TD>
<TD><font size="3">
<input type="text" name="sLOG_MSG_27" size="100" value="<!--#echo var="sLOG_MSG_27"-->
"></font></TD>
</TR>
<TR ALIGN="center" bgcolor="#FFFFFF">
<TD bgcolor="#FFFF66"><font size="3"><span class="Stile2">28</span></font></TD>
<TD><font size="3">
<input type="text" name="sLOG_MSG_28" size="100" value="<!--#echo var="sLOG_MSG_28"-->
"></font></TD>
</TR>
<TR ALIGN="center" bgcolor="#FFFFFF">
<TD bgcolor="#FFFF66"><font size="3"><span class="Stile2">29</span></font></TD>
<TD><font size="3">
<input type="text" name="sLOG_MSG_29" size="100" value="<!--#echo var="sLOG_MSG_29"-->
"></font></TD>
</TR>
<TR ALIGN="center" bgcolor="#FFFFFF">
<TD bgcolor="#FFFF66"><font size="3"><span class="Stile2">30</span></font></TD>
<TD><font size="3">
<input type="text" name="sLOG_MSG_30" size="100" value="<!--#echo var="sLOG_MSG_30"-->
"></font></TD>
</TR>
</TABLE>
<div align="center"><input type="button" onClick="savefile(this.form)" class="key" value=" Save " title=" Save - Alt+S " accesskey="s"/>
<label for="filename" title=" Filename - Alt+A "></label>
<input type="hidden" class="it" size="40" id="filename" name="filename" value="C:\My Documents\filename" accesskey="a"/>
<select name="ext" title=" Extension ">
<option disabled value="utf-8" selected="selected">.txt</option>
</select>
<input type="reset" class="key" value=" Reset " title=" Reset the form to its initial state - Alt+R " accesskey="r"/>
</div>
</td>
</tr>
</table>
</form>
</body>
</html>
[/html]