Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8077901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:37:25+00:00 2026-06-05T15:37:25+00:00

I came accross this html multiple file upload tutorial: http://robertnyman.com/2010/12/16/utilizing-the-html5-file-api-to-choose-upload-preview-and-see-progress-for-multiple-files/ I’m new to web

  • 0

I came accross this html multiple file upload tutorial: http://robertnyman.com/2010/12/16/utilizing-the-html5-file-api-to-choose-upload-preview-and-see-progress-for-multiple-files/

I’m new to web programming enough to not being able to understand how to make a code from the two sections of the ‘complete code’ in this tutorial, which basically are:

A. Some html code:

<h3>Choose file(s)</h3>
<p>
    <input id="files-upload" type="file" multiple>
</p>
<p id="drop-area">
    <span class="drop-instructions">or drag and drop files here</span>
    <span class="drop-over">Drop files here!</span>
</p>

<ul id="file-list">
    <li class="no-items">(no files uploaded yet)</li>
</ul>

B. And some javascript:

(function () {
    var filesUpload = document.getElementById("files-upload"),
        dropArea = document.getElementById("drop-area"),
        fileList = document.getElementById("file-list");

    function uploadFile (file) {
[etc]

I recognize the code, but I don’t understand where a part of code beginning with (function () is supposed to go into my code.

So my question is: how should the javascript part be placed in my code.

[Edit]

Thanks for your complementary answers!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T15:37:26+00:00Added an answer on June 5, 2026 at 3:37 pm

    Either just before the </body> tag, between a <script type="text/javascript"></script> tag like this:

    <body>
    
        <!-- other stuff -->
    
        <script type="text/javascript">
        (function () {
            // this is your function's core
        })();
        </script>
    
    </body>
    

    Or within the <head></head> tag, also between a <script type="text/javascript"></script>, but you have (probably) to wait until the DOM correctly loaded. For example, using jQuery:

    <head>
    
        <!-- other stuff -->
    
        <script type="text/javascript">
        $(function() {
            (function () {
                // this is your function's core
            })();
        });
        </script>
    
    </head>
    

    Or even within an external JavaScript file, where you’ll also have (probably) to wait until the DOM correctly loaded. For example, once again using jQuery:

    file myScripts.js

    $(function() {
        (function () {
            // this is your function's core
        })();
    });
    

    file myDocument.html

    <head>
    
        <!-- other stuff -->
    
        <script type="text/javascript" src="/path/to/myScripts.js"></script>
    
    </head>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

http://www.devcurry.com/2010/05/sorting-json-array.html I came across this article, i want few explantions over this article. function
I came across this link http://www.mathopenref.com/coordpolygonarea2.html It explains how to calculate the area of
I recently came across this web page http://www.yoda.arachsys.com/csharp/readbinary.html explaining what precautions to take when
I just came across this: http://www.askapache.com/htaccess/mod_rewrite-tips-and-tricks.html --> check under removing the query string. It
I came across this primer on coding HTML: http://css-tricks.com/examples/CleanCode/Beautiful-HTML.png . Among other things it
I came across this example class http://www.boost.org/doc/libs/1_49_0/libs/smart_ptr/sp_techniques.html#as_lock and I'm struggling with the syntax. class
So I was reading http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html , and came across this: type __sync_and_and_fetch (type *ptr,
I came across this link: http://ofps.oreilly.com/titles/9780596805784/ which seems to suggest web app can be
I came accross this html snippet & to my surprise jQuery Object does get
I came accross this code on the web: is_char(Ch) -> if Ch < 0

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.