Category Archives: dhtml

Una serie di links a video tutorials

The JavaScript Programming Language (by Douglas Crockford)
Yahoo! JavaScript Architect Douglas Crockford provides a comprehensive introduction to the JavaScript Programming Language in this four-part video:

  • JavaScript Video Lecture Part I (Yahoo Video)
    JavaScript, aka Mocha, aka LiveScript, aka JScript, aka ECMAScript, is one of the world's most popular programming languages. Virtually every personal computer in the world has at least one JavaScript interpreter installed on it and in active use. JavaScript's popularity is due entirely to its role as the scripting language of the WWW. Despite its popularity, few know that JavaScript is a very nice dynamic object-oriented general-purpose programming language. How can this be a secret? Why is this language so misunderstood?
  • JavaScript Video Lecture Part II
    JavaScript's C-like syntax, including curly braces and the clunky for statement, makes it appear to be an ordinary procedural language. This is misleading because JavaScript has more in common with functional languages like Lisp or Scheme than with C or Java. It has arrays instead of lists and objects instead of property lists. Functions are first class. It has closures. You get lambdas without having to balance all those parens.

  • JavaScript Video Lecture Part III
    Nearly all of the books about JavaScript are quite awful. They contain errors, poor examples, and promote bad practices. Important features of the language are often explained poorly, or left out entirely. I have reviewed dozens of JavaScript books, and I can only recommend one: JavaScript: The Definitive Guide (5th Edition) by David Flanagan.

  • JavaScript Video Lecture Part IV
    Most of the people writing in JavaScript are not programmers. They lack the training and discipline to write good programs. JavaScript has so much expressive power that they are able to do useful things in it, anyway. This has given JavaScript a reputation of being strictly for the amateurs, that it is not suitable for professional programming. This is simply not the case.

  • Lecture Slides (zipped pdf)

Advanced JavaScript (by Douglas Crockford)
Yahoo! JavaScript Architect Douglas Crockford lectures on the nuances of the JavaScript programming language in this three-part video:

  • Advanced JS Part I (Yahoo Video)
    Douglas Crockford teaches "Advanced JavaScript." This course is broken into three clips; this is the first of those three clips. Note that when Douglas begins the talk referring to the "third installment", he's referring to "Advanced JavaScript" being the third class in a series; this is indeed the first of the three clips comprising the "Advanced JavaScript" class.

  • Advanced JS Part II
    No programming language is perfect. JavaScript has its share of design errors, such as the overloading of + to mean both addition and concatenation with type coercion, and the error-prone with statement should be avoided. The reserved word policies are much too strict. Semicolon insertion was a huge mistake, as was the notation for literal regular expressions. These mistakes have led to programming errors, and called the design of the language as a whole into question.

  • Advanced JS Part III
    The official specification for the language is published by ECMA. The specification is of extremely poor quality. It is difficult to read and very difficult to understand. This has been a contributor to the Bad Book problem because authors have been unable to use the standard document to improve their own understanding of the language. ECMA and the TC39 committee should be deeply embarrassed.

  • Lecture Slides

Advanced JavaScript with Libraries (by John Resig)
John Resig of Mozilla Corp., author of the popular JQuery JavaScript library, describes the role of libraries in the world of frontend engineering, the problems they solve, and the things we can learn from how developers use and think about libraries in their projects.

Maintainable JavaScript (by Nicholas Zakas)
Nicholas Zakas is an engineer on the team that brings you My Yahoo!, one of the most popular personalized portals on the web. In this talk, Zakas focuses on some fundamental concepts in the world of frontend engineering with an eye toward making code more maintainable.

An Inconvenient API: The Theory of the DOM [Document Object Model] (by Douglas Crockford)
Yahoo! JavaScript Architect Douglas Crockford discusses the nexus between JavaScript and the browser, exploring the history of the BOM and DOM APIs and their impact on frontend engineering today. This presentation is archived in three parts:

Welcome to FireBug 1.0 (by John Hewitt)
Joe Hewitt is a Mozilla developer who has written software dear to the heart of all web developers, including the original Mozilla DOM Inspector. Joe's newest Mozilla tool is Firebug, an integral logging and debugging extension for Firefox that sets a new standard for its category. Joe provided a power-user tour while announcing Firebug 1.0's release on January 25, 2007, at Yahoo!.

New Features in the Next C++ Standard

The upcoming C++ standard will have many new features, several major and many minor. The major features are concurrency, template concepts, move semantics, generalized constant expressions, automatic variable typing, and garbage collection. We will present an overview of the major features and breeze through a list of other features, commenting on their likeliness to make the standard.

Advanced Python (Or Understanding Python)

The Python language, while object-oriented, is fundamentally different from both C++ and Java. The dynamic and introspective nature of Python allow for language mechanics unlike that of static languages. This talk aims to enlighten programmers new to Python about these fundamentals, the language mechanics that flow from them and how to effectively put those to use. Among the topics covered are duck-typing, interfaces, descriptors, decorators, metaclasses, reference-counting and the cyclic-garbage collector, the divide between C/C++ data and Python objects and the CPython implementation in general.

This talk is part of the Advanced Topics in Programming Languages series. The goal of this series is to encourage all of the people at Google who know and love programming languages to share their knowledge.

Python Design Patterns (by Alex Martelli)

Design Patterns must be studied in the context on the language in which they'll get implemented (the Gang of Four made that point very strongly in their book, though almost everybody else seems not to have noticed :-). This talk explores several categories of classic "elementary" DPs in a Python context -- Creational, Masquerading, Adaptation, and Template.

Learning Java Programming - Video Tutorial

Delphi Training Series: Programming 101 (by 3DBuzz)
Ever wanted to become a programmer? The Delphi Training Series: Programming 101 is a sequence of training videos designed to teach the complete beginner how to become a programmer using Delphi.

  • Dephi Programming Episode 1 (YouTube video)
    In this episode, the viewer is shown where they can download the free Integrated Development Environment (IDE) known as Turbo Delphi, as well as how to get it installed and registered. Once launched the video will walk the viewer through the creation of their first simple program.
  • Dephi Programming Episode 2
  • Dephi Programming Episode 3
    Episode 3 explores simple game design!

  • Dephi Programming Episode 4
    In this episode, the viewer is introduced to the concept of variables.
    This video is the first in a mini-series aimed at the creation of your own MP3 player.

  • Dephi Programming Episode 5
    In this episode, the viewer is exposed to the world of Procedures and Functions.
    This video continues the series with focus on writing your own mp3 player.

  • Dephi Programming Episode 6
    In this episode, the viewer is presented with lecture covering DLLs, handles, the BASS library, and all steps required to write the foundation of a simple MP3 player.

  • Dephi Programming Episode 7
  • Dephi Programming Episode 8
    In the eighth installment of the Delphi Training Series, we take a short break away from the MP3 player we were writing to introduce you to a new aspect of programming: The IF statement.

  • Dephi Programming Episode 9
    The ninth episode of the Delphi Training Series is another theory-driven exploration, stepping away from the MP3 player to take a look at looping and how it works inside of Object Pascal.

Vim: 7 Habits For Effective Text Editing (by Bram Moolenaar)

A large percentage of time behind the computer screen is spent on editing text. Investing a little time in learning more efficient ways to use a text editor pays itself back fairly quickly. This presentation will give an overview of the large number of ways of using Vim in a smart way to edit programs, structured text and documentation. Examples will be used to make clear how learning a limited number of habits will avoid wasting time and lower the number of mistakes. Bram Moolenaar is mostly known for being the benevolent dictator of the text editor Vim. His roots are in electrical engineering and for a long time he worked on inventing image processing algorithms and software for big photo copying machines. At some point his work on Open-Source software became more important, making the development of Vim his full time job. He also did the A-A-P project in between Vim version 6.0 and 7.0. Now he works for Google in Zurich, still improving Vim on the side.

Bonus Lecture this Month:
An Introduction to SQLite (by Richard Hipp)

SQLite is a small C library that implements a self-contained, embeddable, zero-configuration SQL database engine. SQLite implements a large subset of SQL-92 and stores a complete database in a single disk file. The library footprint is less than 250 KB making is suitable for use in embedded devices and applications where memory space is scarce.

This talk provides a quick overview of SQLite, its history, its strengths and weaknesses, and describes situations where it is much more useful than a traditional client/server database. The talk concludes with a discussion of the lessons learned from the development of SQLite and how those lessons can be applied to other projects.

Realizzare uno slider con javascript

var tempo=100;
var val=10;
var max=100;
var min=10;

function apri(){

function chiudi(){

function aumenta(){

function diminusci(){

function muovi(quanto){

function ObjById( id )
    if (document.getElementById)
        var returnVar = document.getElementById(id);
    else if (document.all)
        var returnVar = document.all[id];
    else if (document.layers)
        var returnVar = document.layers[id];
    return returnVar;


<input type="button" value="apri" onclick="javascript:apri(val);">
<input type="button" value="chiudi" onclick="javascript:chiudi(val);">

<div id="cosa" style="background-color:red;">contenuto del blocco da sccrollare</div>

Upload di file come gli allegati di google

In questo tutorial vedremo come creare un sistema simile a quello gi gmail per allegare i file alle email. Funziona che se si clicca su aggiungi altro file, appare un box con un input per allegare il file.


<input type="file" name="attachment" id="attachment" onchange="document.getElementById('moreUploadsLink').style.display = 'block';" />
<div id="moreUploads"></div>
<div id="moreUploadsLink" style="display:none;"><a href="javascript:addFileInput();">Aggiungi altro file</a></div>


var upload_number = 2;
function addFileInput() {
     var d = document.createElement("div");
     var file = document.createElement("input");
     file.setAttribute("type", "file");
     file.setAttribute("name", "attachment"+upload_number);

Conoscere la posizione della scrollbar in javascript

function f_scrollLeft() {
        return f_filterResults (
                window.pageXOffset ? window.pageXOffset : 0,
                document.documentElement ? document.documentElement.scrollLeft : 0,
                document.body ? document.body.scrollLeft : 0
function f_scrollTop() {
        return f_filterResults (
                window.pageYOffset ? window.pageYOffset : 0,
                document.documentElement ? document.documentElement.scrollTop : 0,
                document.body ? document.body.scrollTop : 0
function f_filterResults(n_win, n_docel, n_body) {
        var n_result = n_win ? n_win : 0;
        if (n_docel &#038;& (!n_result || (n_result > n_docel)))
                n_result = n_docel;
        return n_body &#038;& (!n_result || (n_result > n_body)) ? n_body : n_result;

La funzione javascript GetElementsByClass

function getElementsByClass(searchClass,node,tag) {
        var classElements = new Array();
        if ( node == null )
                node = document;
        if ( tag == null )
                tag = '*';
        var els = node.getElementsByTagName(tag);
        var elsLen = els.length;
        var pattern = new RegExp('(^|\\s)'+searchClass+'(\\s|$)');
        for (i = 0, j = 0; i < elsLen; i++) {
                if ( pattern.test(els[i].className) ) {
                        classElements[j] = els[i];
        return classElements;

Inserire un testo nella posizione del cursore in un campo textfield

function insertAtCursor(campo, stringa) {
  if (document.selection) {
    sel = document.selection.createRange();
    sel.text = stringa;
  else if (campo.selectionStart || campo.selectionStart == '0') {
    var startPos = campo.selectionStart;
    var endPos = campo.selectionEnd;
    campo.value = campo.value.substring(0, startPos)
                  + stringa
                  + campo.value.substring(endPos, campo.value.length);
  } else {
    campo.value += stringa;

che possiamo richiamare tramite:

insertAtCursor(document.formName.fieldName, 'this value');

Menu a comparsa laterale

Creare il menu

La prima e più importante parte della realizzazione del nostro menu è la struttura stessa del menu. La cosa migliore da fare è creare un elenco non ordinato, con ogni sotto menu che a sua volta compare come elenco non ordinato all'interno della voce dell'elenco genitore. Suona complicato? Invece è davvero molto semplice:

<li><a href="#">Home</a></li>
<li><a href="#">About</a>
<li><a href="#">History</a></li>
<li><a href="#">Team</a></li>
<li><a href="#">Offices</a></li>
<li><a href="#">Services</a>
<li><a href="#">Web Design</a></li>
<li><a href="#">Internet
<li><a href="#">Hosting</a></li>
<li><a href="#">Domain Names</a></li>
<li><a href="#">Broadband</a></li>
<li><a href="#">Contact Us</a>
<li><a href="#">United Kingdom</a></li>
<li><a href="#">France</a></li>
<li><a href="#">USA</a></li>
<li><a href="#">Australia</a></li>

Continua a leggere su :