What Is a Pop-Up Window and How to Create a Pop-up for Your Website

May 11th, 2012
create pop up window

At last you can create a pop-up window for your website! Whether a law imposes it or just for your own requirements, there are times when it’s necessary to say something to users who visit your site.

What Is a Pop-Up Window

A pop-up window is a window that automatically appears (pops up) when you browse the web. It is displayed at the top of the current window. Marketers use pop-ups for advertising and special offers. Thanks to this, you can easily inform your customers about news or discounts.

How to Create a Pop-up Window

With Webnode, the steps are the same as adding a widget with an embed code (HTML).

The code required to run the tool is as follows (all characters and symbols are to be copied as they are here. The code will not work if you change anything!)

<script type="text/javascript">
<!--
var answer = confirm("WRITE THE MESSAGE OF THE WINDOW HERE");
if (!answer){
window.location = "WRITE THE ALTERNATIVE WEB ADDRESS HERE";
}
//-->
</script>

Once you have copied the code, only replace the phrase in quotes that you want displayed, and enter the URL of the site where the visitor (who does not meet your requirements) will be redirected. Be sure to keep the quotes for both the message and the web address.

Publish and It’s Ready

As soon as you publish the changes, the pop-up window starts showing. Remember, you can create pop-ups on any of your pages or subpages. However, note that this type of automated messages can discourage visitors. So we recommend its use only for cases where it is really necessary.

Learn more about website builders and how to choose one