Javascript Function Snippets


If you're looking for a great way to enable your visitors to navigate your web site, this JavaScript drop down box with automatic redirect may be what you're looking for. This JavaScript code will enable your visitors to click on a drop down box to select the location on your web site in which they would like to navigate. Once they make their...

03 April, 2011   

If you're looking for a JavaScript code to enable you to create a first visit pop up window for your web site, you've come to the right place. Pop up windows can provide a great way to gain new subscribers to your publication and even increase your sales. However, they can also be very irritating to your visitors. For this reason, you may want...

22 September, 2012   

Allows you to take a user to the previous page they were on using a button

18 September, 2012   

Attempts to close the current window. You can use it for popups

26 November, 2011   

In jQuery $ is an alias for jQuery, so you can use jQuery() for accessing the jQuery methods. The following code example shows how you can use other libraries with jQuery:

Optimize your website loading time by compressing files into smaller size.

05 February, 2014   

We created a slide show that allowed the user to move through an array of images.

20 December, 2011   

The example below defines a loop that starts with i=0. The loop will continue to run as long as i is less than, or equal to 5. i will increase by 1 each time the loop runs.

20 December, 2011   

The example below defines a loop that starts with i=0. The loop will continue to run as long as i is less than, or equal to 5. i will increase by 1 each time the loop runs:

29 December, 2016   

JavaScript code snippet to test if Mac or PC

How to close child window when parent window is closed using JavaScript in asp.net application

Most today's web browsers like Firefox (Ctrl+D), Opera (Ctrl+T) and IE (Ctrl+D) provide a keyboard shortcuts to enable users bookmark their favorite pages. But if you want to provide your visitors with a "Bookmark this page" link they can click you may use the code below: It works in IE, FireFox and Opera. Clicking on the link prompts...

26 September, 2011   

Pop up windows can provide a great way to gain new subscribers to your publication and even increase your sales. However, they can also be very irritating to your visitors. For this reason, you may want to use a pop up window JavaScript code that will only load the pop up window on your visitor's first visit. That way you're not continually...

10 April, 2012   

Protect your web page content with JavaScript code

JavaScript Code example to protect Your Web Page Content

14 July, 2014   

A few points of interest: * The HREF links use JavaScript to set a browser cookie named "style". * Since we are only setting one cookie and it's name is "style", we can read its value using "document.cookie.charAt(6)". * If no cookie is set, "StyleFile" will evaluate to "style.css". * The...

Note: The ASP.Net RadioButtons must be set with exact same GroupName property in order to make them mutually exclusive.

22 August, 2012   

This JavaScript code will enable you to display text within your status bar that is typed line by line.

27 August, 2012   

HTML code for Top & Bottom Halves Layout

When a KeyboardEvent fires, you can test which key was pressed because that event contains information you can write logic against.