c-- styles for logos and headline links do not modify internet, red, or black styles -->

Intranet Journal   Earthweb  
Events Jobs Premium Services Media Kit Network Map E-mail Offers Vendor Solutions Webcasts

   Intranet Journal Subjects
Search Earthweb

Privacy Policy



internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

internet commerce
Be a Commerce Partner
















 

[ Home | Discussion Forum | How Do I... | Lotus Notes Intranets | Microsoft SharePoint | Products | Shopping  ]

free news!

Some Other JavaScript Sources On IDM
·  JavaScript FAQ
· Basic JavaScript with Examples
·   Javascript Event Handlers
·   Putting JavaScript to Work
·   eXchange Thread: Javascript for Date Last Changed & Y2K
·   JS/Configurator: A Computer Cost Estimator
·   A Look at JavaScript in Microsoft IE vs. Netscape Communicator
·   JavaScript Forms and Frames: Enhancing HTML on the Client Side
·   JS/Configurator: A Computer Cost Estimator

Tutorial: Introduction to JavaScript


By Aaron Weiss

Operators

Object manipulation

for...in

The sometimes confusing for...in statement is used to cycle through each property of an object or each element of an array. The idea is that you may want to execute a statement block which operates on every property or element.
for (variable in object) 
 { statements; }

Imagine, for example, that an object named wine1 has five properties: vineyard, year, varietal, alcohol, and color. You want to output the value of each property, as if producing a record from a database.

var record = "Wine 1<br><br>"
for (var prop in wine1)
 {record += prop + " = " + wine1[prop] + "<BR>"}
record += "<br>"
document.write(record)

 

with

The with statement serves as a sort of shorthand, allowing you to execute a series of statement who all assume a specified object as the reference. In other words, the object specified in the with statement is used as the default object whenever a property is encountered with no object specified.
with (object) 
 { statements; }

 

JavaScript Tutorial   [Previous: Loops | Next: Comments]

[print version of this page]

IntranetDesignMagazine

 JavaScript Tutorial

Discuss
JavaScript
in the eXchange!


Contents
· VERSIONS OF JAVASCRIPT

· EMBEDDING JAVASCRIPT

· JAVASCRIPT GRAMMAR

· VARIABLES AND DATA TYPES

· OPERATORS
· Arithmetic or Computational
· Comparison
· Boolean
· String and Assignment
· Special
· Statements
· Conditionals
· Loops
· Object Manipulation
· Comments

· FUNCTIONS
· Defining Funtions
· Calling Functions

· OBJECTS
· Document Object Model
· Properties
· Methods
· Creating Objects

· EVENT HANDLERS

· CONCLUSION