JavaScript.com Latest JavaScripts http://www.javascript.com JavaScript.com is your gateway to all things JavaScript. Featuring JavaScript tutorials, free scripts, tools, and links and more! This channel features content from JavaScriptSource.com. en Copyright 2004 Jupitermedia Corp. Introduction to the Document Object Model http://www.brainjar.com/dhtml/intro/ The Document Object Model, or DOM, is the interface that allows you to programmatically access and manipulate the contents of a Web page. This tutorial is a discussion on the DOM representation of a document and the methods it provides to access those objects. Number Formatting http://javascriptsource.com/forms/number-formatting.html These two functions clean up and format numbers quite nicely. One function takes any decimal number, negative or positive, and formats it by adding commas every three digits. The other function strips any non-numeric characters from a string leaving you with a valid decimal number. It considers the minus sign and the period to be numeric and will not strip them unless the minus sign is not at the beginning of the number or there is more than one period. These functions make use of regular expressions to do the heavy lifting. GetPosition 2 http://javascriptsource.com/snippets/getposition-2.html This code returns the position of a given element in a given container, relative to other elements of its type. Very useful for finding position indexes of list items, pictures, form items, and more. Cookie.isEnabled http://javascriptsource.com/cookies/cookie-isenabled.html This function checks whether cookies are enabled in the browser. Returns true on success and false otherwise. JSONVid: Pure JavaScript Video Player http://ajaxian.com/archives/jsonvid-pure-javascript-video-player Jacob Seidelin went on a mission to create a pure JavaScript video player that didn't use Flash. The result: JSONVid. XMLWriter http://javascriptsource.com/ajax/xmlwriter.html This is a JavaScript class, based on .NET's XMLTextWriter. This is not a port, but a reduced and adapted version. It allows you to easily generate XML. The script is heavily commented for complete understanding. HTML Block Scroller & Marquee http://javascriptsource.com/miscellaneous/html-block-scroller-marquee.html This small script will animate a series of blocks of HTML, scrolling them up, down, left or right dynamically and then pausing before starting the next scroll. The script will also pause on mouseover, and resume scrolling on mouseout. Since it scrolls HTML instead of just images, you can include just about anything that can be ordinarily placed in a static HTML document: links, images, graphics, tables, backgrounds, etc. Alternate Colors http://javascriptsource.com/miscellaneous/alternate-colors.html Most scripts that provide alternating rows of color are made for tables. This script can be used with any HTML tag, e.g., DIV, P, etc. Very easy to set-up and implement. Highlight that special section on your page without too much fuss. Delete Confirmation http://javascriptsource.com/snippets/delete-confirmation.html When writing many types of Web applications, there is sometimes a need to let a user delete something. It is generally a good practice, however, to have the user confirm their intentions. One method of doing this is by using a snippet of code to bring up a confirmation message. This snippet can be easily added to an existing or new script or application. An Introduction to JavaScript Object Notation (JSON) http://www.webreference.com/programming/javascript/ JavaScript Object Notation, or JSON for short, is a lightweight data-interchange format which may prove to be a viable alternative to XML for IT developers. It's easy to read and write by people as well as for machines to parse and generate. Check for Leap Year http://javascriptsource.com/time-date/check-for-leap-year.html This snippet will check whether a date belongs to a leap year. Easy to add to an existing script. Virtual Keyboard Interface http://javascriptsource.com/forms/virtual-keyboard-interface.html This script is a reusable system for adding a graphical keyboard interface to text fields, password fields, and textareas so they can be filled with mouse only. It also adds easy access to special characters your existing keyboard may not otherwise have the ability to generate. Comes with Arabic, Belgian, Dutch, Dvorak, French, German, Greek, Hebrew, Hungarian, Italian, Lithuanian, Norwegian, Number Pad, Polish Programmers, Portuguese, Russian, Slovenian, Spanish (Spain), Turkish-F, Turkish-QWERTY, UK, US Standard and US International keyboard layouts, dynamically selectable. Add additional layouts is simple. Easily implemented on any Web site. Mootools http://javascriptsource.com/miscellaneous/mootools.html This is a compact, modular, object-oriented JavaScript framework designed for the intermediate to advanced JavaScript developer. It allows you to write powerful, flexible, and cross-browser code with its elegant, well documented, and coherent API. Advanced JavaScript Debugging Techniques http://www.sitepen.com/blog/2008/04/03/advanced-javascript-debugging-techniques/ The purpose of this tutorial is to provide a list of advanced debugging techniques that are not easily found elsewhere on the web. We all worship at the altar of Firebug, but there are things that can go beyond a console.log(). Code Prettifier http://javascriptsource.com/miscellaneous/code-prettifier.html This script displays syntax highlighting of source code snippets, making the posting of code in an HTML page easier to read. It works on a number of languages including C, Java, Python, Bash, SQL, HTML, XML, CSS, JavaScript, PHP, Ruby, Awk and Makefiles. Heavily commented. Easy to implement.