Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it
    Registrato dal
    Jan 2007
    Messaggi
    16

    problemi window.open con firefox

    problemi con firefox, window.open
    ciao a tutti, ho un problema con Explorer e Firefox.
    O almeno con Firefox, con Explorer funziona tutto.

    ho questo javascript che mi apre una finestra, per salvare dei file, ma in firefox non funziona?!


    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
    }


    questa invece e il tasto per il richiamo

    <input type="button" onClick="savefile(this.form)" class="key" value=" Save " title=" Save - Alt+S " accesskey="s"/>
    grzie mille per qualsiasi aiuto

  2. #2
    Utente di HTML.it L'avatar di Threepwood
    Registrato dal
    Feb 2003
    Messaggi
    2,107
    Prova ad aprire la console di Firefox e a vedere se ti torna un errore (e a che riga)
    Guybrush Threepwood

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.