W3C.US

  • Increase font size
  • Default font size
  • Decrease font size
Welcome to the W3C.us

Javascript & DOM (1)

E-mail Print PDF

What's DOM?

DOM is Document Object Model. Document object is the part of a document. In a html document, the base document objects that javascript can access include: window, document, location, navigator, screen and history etc.

If we want to refer a document object in the page, we must list all of its parent's node. For example, we want to get the object of the form “applicationForm”'s Textinput “customerName”, we should use document.applicationForm.customerName to get it.

Read more...
 

JavaScript array basics

E-mail Print PDF

 

Learn how to use JavaScript arrays. In this tutorial you learn what a JavaScript array is, how to create an array, how to access an array's contents, how array lengths work, and how to loop through arrays.

Like most languages, JavaScript lets you create arrays to store bunches of values in. An array is simply a sequence, or list, of values. A value in a JavaScript array can be anything from a number or string, through to a function or an object; JavaScript arrays can store pretty much any type of data. A single value in a JavaScript array is called an element.

With JavaScript arrays, you can:

  • Store any number of values, including no values at all (known as an empty array)
  • Access any or all the elements of an array through a single variable name
  • Read and write elements of an array
  • Loop through all the elements of an array
  • Join two or more arrays together to make one longer array
  • Convert an array to one long string
  • Add or remove elements from the beginning, end, or middle of an array
  • Reverse the order of the elements in an array
  • Sort the elements of an array in any order you like
  • Nest arrays within other arrays
Last Updated on Thursday, 21 May 2009 23:52 Read more...
 

Check if it is null

E-mail Print PDF

As we known, null has no property, we cannot get its existence, and if we access null.property, got an error, but not an undefined

To consider the code below:

if (node.nextSibling.className == ...) {
   ...
}

If node is null, or node.nextSibling is null, the sentence will return error.

So the temporary solution is:

Read more...
 

A brief history about actionscript

E-mail Print PDF

 Early syntax of ActionScript 1 with Flash 3 was simple and verbose and functionality was based mainly around frame navigation and basic mouse interaction. This remained consistent until about Flash 5 where ActionScript assumed a form more similar to JavaScript. This provided a great deal more functionality and a "dot-syntax" for variable and method access. ActionScript also became a prototyped language allowing for simple OOP functionality similar to that available in JavaScript. This was enhanced in the following release of Flash, Flash MX (6).

Read more...
 

The Javascript Trap

E-mail Print PDF

You may be running non-free programs on your computer every day without realizing it—through your web browser.

In the free software community, the idea that non-free programs mistreat their users is familiar. Some of us refuse entirely to install proprietary software, and many others consider non-freedom a strike against the program. Many users are aware that this issue applies to the plug-ins that browsers offer to install, since they can be free or non-free.

Read more...
 

Reserved Words

E-mail Print PDF

In ECMAScript v5, javascript's reserved words are 3 parts: keywords, future reserved words, predefined global variable and function.

Keywords:

Javascript Keywords
break do instanceof typeof case else
new var catch finally return void
continue for switch while debugger function
this with default if throw delete
in try        

Read more...
 


Page 2 of 4

Polls

How do you find w3c.us?
 

Who's Online

We have 1 guest online

Advertisement

Featured Links:
Joomla!
Joomla! The most popular and widely used Open Source CMS Project in the world.
JoomlaCode
JoomlaCode, development and distribution made easy.
Joomla! Extensions
Joomla! Components, Modules, Plugins and Languages by the bucket load.
Joomla! Shop
For all your Joomla! merchandise.