diTii.com Digital News Hub

Sign up with your email address to be the first to know about latest news and more.

I agree to have my personal information transfered to MailChimp (more information)


DOMInclude: Replacing pop-ups

DOMInclude is a library that allows you to add inline dynamic includes of content rather than using window popups.

Pop-up windows are a pain for both the developer and the users. Often enough a page needs to link to a terms and conditions document and as the client does not want the user to leave the page you are asked to implement them in a pop-up.

The problem with this are technical and psychological:

  • years of unsolicited pop-up windows have conditioned users to immediately close windows when they open
  • the same reason and security concerns made people install pop-up blocker software and browsers to include pop-up blocking options, and depending on their configuration these may even block your “friendly pop-ups”.


Simply insert DOMinclude in the head of your document with these two script tags:


Add a class called DOMpop to each link you want to turn into a popup like the ones shown here.

photo of a confused puppy

Alter the configuration by editing the DOMinclude_config.js file:

DOMinccfg={ // CSS classes // trigger DOMinclude triggerClass:'DOMpop', // class of the popup popupClass:'popup', // class of the link when the popup // is open openPopupLinkClass:'popuplink', // text to add to the link when the // popup is open displayPrefix:'Hide ', // filter to define which files should // not open in an iframe imagetypes:'jpg|JPG|JPEG|jpeg|gif|GIF|png|PNG', // dimensions of the popup frameSize:[320,180] }
[Source: ajaxian.com]
Share This Story, Choose Your Platform!

Get Latest News

Subscribe to Digital News Hub

Get our daily newsletter about the latest news in the industry.
First Name
Last Name
Email address
Secure and Spam free...