JavaScript Codes

 

JavaScript Codes

JavaScript codes are used within the HTML portion of a web page, or on a web server, to add special effects to a web page.

Elements such as links, images and forms can all be manipulated using this powerful technology.

Unlike CGI scripts, JavaScript codes can be placed directly into your HTML code. It can also reside on your server and be called from a small code within your web page.

If you’d like to place your JavaScript code within a file on your server, you will need to open a plain text editor and place your JavaScript code within the editor. The JavaScript code file should then be saved with a .js extension.

In order to call your JavaScript code, you will need to link to the file. You can do so by placing a small JavaScript code within the HTML of your web page that looks something like this:

<script language=”Javascript” src=”http://www.yoursite.com/yourfile.js”>

This powerful scripting language can be used to create special effects within your web page, such as link effects, mouseovers, image roll overs, navigational systems and much more.

JavaScript to Avoid

Although JavaScript codes can certainly help you spice up your website, there are many scripts that your visitors may find irritating. Try to avoid scripts such as mouse trailers, mouseover sounds, mouseover pop up windows and mouseover redirects.

Carefully select scripts that will enhance your visitors experience and encourage them to return in the future.

JavaScript Code Snippets

If you’re looking for some simple JavaScripts to spice up your website, you will find a variety of code snippets below. Click on the links and copy and paste the codes into your web page according to the instructions.

 

Reload a window with a link

Redirect to another page

Back to previous page

Email Button

Link alert box

Display date time on web page

Drop down redirect box

• Display an Alert Message on Web Page Load

• Creating a Print Web Page Button

 
This concludes the JavaScript Codes section. For additional tips and codes, visit the Web Design Tips section.

 

 
Visit the following pages for a wealth of copy and paste codes and tips:

HTML Tips
Copy and paste special effect HTML codes for your web page.

HTML Codes
An HTML codes chart you can use to copy and paste codes into your web page.

HTML Color Codes
An HTML color codes chart you can use to copy and paste color codes into your web page.

JavaScript Codes
Copy and paste special effect JavaScript codes for your web page.

Web Design Tips
Tips, tricks, and special effect codes for your web page.

HTML Tags
A list of HTML tags.

HTML 5 Tags
A list of the latest HTML tags to be developed.

ASCII Codes
Special text characters and code for your web page.