Return to Kroll Web Design home page JavaScript     

« Return

JavaScript is a programming language which is used in millions of web pages worldwide.
This page contains links to some useful JavaScript information and examples.
Examples of JavaScript in action:
• dynamic form - creates a form to invoke Google Trends
• PHP script used with JavaScript to count how often each letter a thru z occurs in the text that you type or paste into a text area.
Arrays (see also - Strings):
• arrays
• concat method - join multiple arrays into one array.
• join method - merge array elements into one string.
• length property - contains the arrays's length.
• multidimensional named arrays
• multidimensional numbered arrays
• pop method - remove and return the last element.
• push method - add element to end of array.
• reverse method - reverse the order of all elements.
• shift method - remove and return the first array element.
• slice method - returns a portion of the array.
• sort method - sorts the array.
• splice method - remove or replace array elements.
• toString method - merge array elements into one string.
• unShift method - add element to start of array.
Date object:
• date and time methods
DOM (Document Object Model):
• DOM anchors and links arrays
• DOM history object
• DOM images array
• DOM lastModified property
• DOM referrer property
Flow of Control Statements:
• for loop
• if statement
• switch statement
Functions:
• local variables - variables that exist only within a function.
• setTimeout function - run javascript once, after specified delay.
Input/Output:
• prompt() method - request that the user input data.
• write() method
• writeln() method
Operators:
• equality operator ==
• exclusive or
• inequality operator !=
• logical operators
• math operators
• questionmark operator ?
• typeOf operator - find the first number in a character string.
Strings (see also - Arrays):
• charAt method - returns character at specified location.
• indexOf method - search for specified substring.
• length property - contains the string's length.
• lastIndexOf method - search for substring, work right to left.
• parseInt method - search for number within a string.
• remove blanks from strings - using charAt method in a loop.
• split method - convert the delimited string into an array.
• substring method - copy (not cut) a substring from a string.
• toLowerCase() method - convert string to lower case.
• toUpperCase() method - convert string to upper case.
Windows:
• window.open for pop-ups and pop-unders
• window properties
Other topics:
• background image
• comments
• re-directing to another page
• splitting a script



©2010 Kroll Web Design    davidarthurkroll@verizon.net    781.910.3694

Valid XHTML 1.0 Transitional Valid CSS!