Visualizzazione dei risultati da 1 a 5 su 5
  1. #1

    apertura automatica popup

    ho creato un popup che mostra un'immagine all'apertura della pagina web.
    In un normale file html funziona, ma nel file php no.
    ecco il codice:
    <html>
    <head>
    <script language='javascript'>
    var style="scrollbar=no,status=no,resizable=no,width=3 00,height=250";
    function popup()
    {
    msg=window.open('','',style);
    msg.document.write("<html><head><title>titolo</title></head>");
    msg.document.write("<body background=image.jpg>"></body></html>);
    }
    </script>
    </head>

    <body>
    <script language='javascript'>
    <!--
    popup();
    -->
    </script>

    grazie a chi mi risponderà

  2. #2
    richiama la funzione così:

    codice:
    <body onLoad="popup();">
    fammi sapere.

  3. #3
    Mi dispiace ma non funziona lo stesso. credo che abbia dei problemi con window.open, ma non riesco a capire dove sia l'errore. Quello che mi stupisce è che con il file html funziona.

    grazie mille e buone feste

  4. #4
    Originariamente inviato da pegasobiu
    Mi dispiace ma non funziona lo stesso. credo che abbia dei problemi con window.open, ma non riesco a capire dove sia l'errore. Quello che mi stupisce è che con il file html funziona.

    grazie mille e buone feste
    non saprei cosa dirti... prova postando il codice del file PHP...

  5. #5
    <script language='javascript'>
    var style = "scrollbars=no,status=no,resizable=no,width=300,he ight=250";
    function popup()
    {
    msg=window.open("","",style);
    msg.document.write("<html><head><title>titolo</title></head>");
    msg.document.write("<body background=image.jpg></body></html>");
    }
    popup();
    </script>
    c'erano un sacco di errori

    in php

    Codice PHP:
    print "
    <script language=\"javascript\"> 
    var style = \"scrollbar[B]s[/B]=no,status=no,resizable=no,width=300,height=250\"; 
    function popup() 

    msg=window.open(\"\",\"\",style); 
    msg.document.write(\"<html><head><title>titolo</title></head>\"); 
    msg.document.write(\"<body background=image.jpg></body></html>\"); 
    }
    popup();
    </script>
    "

    ciao! buon natale
    «Se leggi dimentichi, se vedi capisci, se fai impari» Piaget

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.