HTML Goodies: Script Tip: Week 5 | HTML Goodies

HTML Goodies: Script Tip: Week 5

Written By
Joe Burns
Joe Burns
Jan 4, 2005
2 minute read


Hello, Script Tip Folk…

Let’s start looking at a new script. This is a little more involved than the last one, so we should be able to really tear it apart and get a lot out of it.

Basically, here’s what this script does:


  • Posts a dialogue box when a person enters the page.
  • The box has text on it that can be altered.
  • The box gives the user the opportunity to click OK to enter the page or Cancel not to enter the page.
  • If the user clicks OK, then the page loads as usual.
  • If the user clicks Cancel, then the script reloads the page the user was coming from.


The script is Copyright ) JemWeb 1997, but HTML Goodies has permission to use it to help you along with your JavaScripting.

That said, here’s what it looks like:











How about that? All that functionality in such a small script!

We’ll start tearing this pup apart by looking at the very first line in the script:


HTML Goodies Logo

The original home of HTML tutorials. HTMLGoodies is a website dedicated to publishing tutorials that cover every aspect of being a web developer. We cover programming and web development tutorials on languages and technologies such as HTML, JavaScript, and CSS. In addition, our articles cover web frameworks like Angular and React.JS, as well as popular Content Management Systems (CMS) that include WordPress, Drupal, and Joomla. Website development platforms like Shopify, Squarespace, and Wix are also featured. Topics related to solid web design and Internet Marketing also find a home on HTMLGoodies, as we discuss UX/UI Design, Search Engine Optimization (SEO), and web dev best practices.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.