navigation
Thomas Brunt's OutFront Hosting
 
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

 

Some JavaScript Snippets
by Katherine Nolan, OutFront Moderator

There are a number of small and fast snippets of JavaScript or other code that many of us use frequently and that are often looked for at the forums. It can be very convenient to have these together in a single file so that they can be referred to quickly and easily. Here are some of the contents of my 'snippets' file - maybe they can form the basis for one of your own.

In all cases the code below should be pasted into your page in HTML view.

1. Close Window

Useful addition to a pop-up window.

a. With a button

Paste wherever you want the button to appear.

b. With a text link

Paste wherever you wish the link to appear.

c. After a given number of seconds

Add the event handler to the <body> tag
20000=20 seconds

 

2. JavaScript Back Button

Returns user to the previous page. 

a. Back With a Button

Paste wherever you want the button to appear.

b. With a Text Link

Paste wherever you wish the link to appear.

 

3. Print Page

a. With a button

Paste wherever you want the button to appear.

b. With a text link

 

4. Break out of Frames

To prevent your page being framed by someone else put this event handler into the <body> tag.

 

5. Add to Favorites

Works in Internet Explorer only

Put the code below on a single line wherever you want the link to appear.

 

6. Specify Referring Page

Handy script to ensure that a user can only reach a given page from another specified page. Paste before the </head> tag of the page.

Some other useful Code

Useful Links

Hotscripts

The JavaScript Source

Dynamic Drive


 

Fun With Background Images
Fun With Bulleted Lists
Are You Compliant?
Introduction To Cascading Style Sheets
Creating Custom Error Pages
Designing Fast Loading Sites
Creating Funky Forms With CSS
htaccess Magic
An Introduction To JavaScript
JavaScript Snippets
Getting More From Mailto
Installing And Using Perl Scripts
Preparing Photos For Your Web Site
The Popup Dilemma
Paint Shop Pro Album 4
Creating And Using robots.txt File
Creating JavaScript Rollover Buttons

Microsoft Corporation in no way endorses or is affiliated with "OutFront." 
OutFront is published and edited by Thomas Brunt
440 Great Circle Dr., St. Matthews, SC 29135.  803-655-6151
© 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 All Rights Reserved
Click here to view our privacy statement.