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'); });




