PhpRiot
Download Article
Download this article in PDF format with all listings and files.

Price: $5.00 AUD
(Approx. $4.35 USD)

More information
Related Books
Learning PHP, MySQL, and JavaScript: A Step-By-Step Guide to Creating Dynamic Websites (Animal Guide)

Learning PHP, MySQL, and JavaScript: A Step-By-Step Guide to Creating Dynamic Websites (Animal Guide)

If you know HTML, this guide will have you building interactive websites quickly. You'll learn...

The Essential Guide to Dreamweaver CS4 with CSS, Ajax, and PHP (Essentials)

The Essential Guide to Dreamweaver CS4 with CSS, Ajax, and PHP (Essentials)

Dreamweaver CS4 is a massive step forward in terms of integration with the rest of the CS4 suite...
PhpRiot Newsletter
Your Email Address:

More information

Monitoring File Uploads using Ajax and PHP

Instantiating the FileUploader JavaScript Class

The final step in making this code work is to actually instantiate the FileUploader JavaScript class. To do this we implement the upload.js file that was loaded in index.php.

All this code does is wait until the page has finished loading then instantiates the class with the appropriate parameters (the ID values for the form and the status container).

Listing 18 Instantiating the FileUploader JavaScript class once the page has loaded (upload.js)
Event.observe(window, 'load', function() {
    new FileUploader('theForm', 'status');
});

In This Article


Additional Files