As you may be aware, loading scripts and styles on a page where they won't be used unnecessarily slows down that page's rendering time, since the browser will still need to download and validate the content of these external files. While the previous recipe's There's More... section offered one way to select specific pages where scripts and styles should be loaded, a different approach is to analyze the page contents for the presence of a special code to make that decision.
This recipe shows how to add a filter to the previous recipe to search for a shortcode in posts and pages to decide when to display a pop-up dialog.