Bookmark

Top Authors

Author Feed Articles Published: 21    
Author Feed Articles Published: 14    
Author Feed Articles Published: 11    
Author Feed Articles Published: 11    
Author Feed Articles Published: 7    
Author Feed Articles Published: 7    
Author Feed Articles Published: 7    
Author Feed Articles Published: 6    
Author Feed Articles Published: 6    
Author Feed Articles Published: 6    


Site Stats


    Free PageRank Display
    Total Category: 24
    6 users online.

Links

ArticlesBusiness.net
OrganizingWeb.net
CreditCardBadCreditPeople
DomainForBusiness.net
Online2Earn.net
Viaggiare-Informati.net
DirectoryResearch.info
DirectoryPlanet.net

Sponsors


Directory Submission

OrganizingWeb Top Site List

Using Dreamweaver To Add Javascript To Your Web Pages



By: AndrewWhiteman Article Word Count: 701 -
    View Summary       View Comments

JavaScript is a simple, client-side scripting language which enables you to add exciting and interesting functionality to your HTML pages. It is built in to most web browsers and, although it can be deactivated, most people will have it enabled within their browser. JavaScript's uses includes the validation of entries within an HTML form and the detection of browser versions and presence or absence of plug-ins. Dreamweaver's implementation of JavaScript centres on the use of what it calls "behaviors".

A Dreamweaver behavior is an automatically generated JavaScript function which is activated by a given user or browser action. To use behaviors, choose Window > Behaviors. Before attaching a behavior, you must highlight one of the elements on your page such as a hyperlink or image. Then you need to choose a behavior by clicking on the plus sign in the top left of the Behaviors window.

You will also need to ensure that the correct event (click, double-click etc.) is linked to the behavior. Dreamweaver will always assign an event automatically. However, if this event is not the one you actually want, just select a different event by clicking on the drop-down menu located to the right of the name of the event in the Behaviors panel.

Dreamweaver has a wide selection of behaviors. However, they fall into four main categories: images, windows and alerts, forms and form fields and CSS. To see how behaviors work, let us look at some examples of some behaviors in each of those categories.

There was a time when almost every website featured the rollover effect on its navigation buttons. With the development of CSS, this is no longer the case. However, the facility of having an image change appearance when the mouse passes over it is still useful. Dreamweaver achieves this effect with the "Swap Image" behavior which can either be added to an image or can be created automatically by inserting a rollover image (Insert > Image Objects > Rollover Image) rather than a static one.

Dreamweaver's "Open Browser Window" behavior allows you to create the controversial JavaScript pop-ups. Due to its extensive misuse, many people have developed an extreme intolerance of this feature. However, there are situations where it is useful. For example, if a user is in the middle of filling out a form and clicks a help icon next to a certain item, a pop-up window is an ideal method of displaying the help topic.

The key behavior relating to forms is called "Validate Form". It performs simple checks on any text field within a given form. (It ignores any fields other than text fields.) To use it, select a field (the validation will then occur when the user leaves the field) or select the entire form (the validation will then occur when the form is submitted). Choose "Validate Form" form the Behaviors panel menu and specify the type of validation you wish to perform, for example, ensuring that a field has not been left blank.

An example of a behavior which manipulates CSS attributes is "Show/Hide Elements". This enables you to control the visibility of the content inside an HTML element, such as a DIV, heading or paragraph, based on user action. So, for example, when if you have a picture of a product, you can create DIVs with information on various aspects of the product and have the appropriate DIV content become visible as the user mouses over various parts of the product image.


Each behavior that you choose will create one or more JavaScript functions within the head area of your page. Part of the process of optimising your website (both in terms of accessibility and search engine compatibility) is to transfer this code to an external JavaScript file and then link the web page to the JavaScript file. To do this, you need to be in Code view and locate the function(s) generated by the behavior(s) you have used on your page. Cut all of the code between the opening and closing SCRIPT tags and place it in a text file which needs to be saved with a .js extension. Next, enter an src attribute inside the opening SCRIPT tag, for example .


Article Source: FreeBusinessContent.net

About the Author

The writer of this article is a developer and trainer with Macresource Computer Solutions, a UK IT training company offering Adobe Dreamweaver Classes at their central London training centre.


More recent articles in Enterpreneur Category


- Why you should integrate your e-commerce with an MYOB accounting package!
- Perth, Australia: Website Design Studio
- With Artisteer You Are A Web Designer in Minutes!
- How to Select a Web Designer
- Businesses and the Importance of Web Design
- Solution To Dissolve Shared Web Hosting Afflictions
- Joomla Development – Data Migration Services
- Web Development India – How Web Development is different from Website Designing
- Need of a Professional Website development Company?
- A Brief Account On The Different Types Of Web Hosting Services

Most Popular Articles

1: Your Chance to Form a Memphis Tn Business
2: Save Money When You Print Postage Online
3: Premium Rate Sms Text - Great Messaging Services For Sellers
4: Getting The Right Equipment For Your Coffee Shop
5: The Ten Greatest Credit Myths
6: Management Classes Can Prepare The Student In All Areas Of Life
7: How to make Internet Marketing a career
8: Is An Online Degree Program For You?
9: The Great Stock Market: Being A Stock Picker And Blue Stocks
10: Workplace Fears That Hurt Your Business and How to Manage Them
11: What You Need To Know About Joint Credit
12: Finding Clients In An Ocean Of Competitors
13: Coupons And Codes For Saving On Jewelry
14: Tips for selecting coffee for your coffee shop
15: High Tech Kitchen Appliances.
16: The Wedding Budget Guide
17: What To Look For In Quality Small Business Ideas
18: three sure fire ways to get paid on a past due account.
19: Management Degree: Exploit Your Natural Potential
20: Payroll Management It's Importance In Business


This Article has been viewed 48 time/s



- Next Article


Rating: Not yet rated
Login to vote




Copy and Paste Article Code.

Remember: The article body, title, author bio and links may not be changed or removed.
By publishing this article, you agree to all the terms in our Terms of Service.