Popup Javascript semplicissimo

Ecco un popup javascript davvero semplice e essenziale, che si può modificare aggiungendo poco codice.

Questo è il testo dello script da inserire tra i tag <head></head> del body.

<script type=”text/javascript”>

function popup(url) {

window.open (url,”,’width=350,height=350,toolbar=yes,resizable=yes’);

}

</script>

E’ importante NON mettere tra apici url , in quanto si tratta di una variabile che assume il valore specificato nel codice html.

Questo è il markup html:

<p style=”text-align: center;”>

<a href=”JavaScript:popup(‘cartella/popup/paginapopup.html’);”>popup</a>

</p>

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.