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 7995479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:25:39+00:00 2026-06-04T14:25:39+00:00

I have a function that is supposed to read from a file into a

  • 0

I have a function that is supposed to read from a file into a variable

I want to know the validity of the reads and was wondering if there was any way I could examine the contents of the variable after the upload action has been performed.

function handleFileSelect(evt) {
    var files = evt.target.files; // FileList object
    // Loop through the FileList
    for (var i = 0, f; f = files[i]; i++) {

        var reader = new FileReader();
        parser=new DOMParser();
        // Closure to capture the file information.
        reader.onload = (function(theFile) {
            return function(e) {
                // Print the contents of the file
                //  var span = document.createElement('span');
                xmlDoc=parser.parseFromString(e.target.result,"text/xml");
                try{
                    DistributomeXML_Objects=xmlDoc.documentElement.childNodes;
                }catch(error){
                DistributomeXML_Objects=xmlDoc.childNodes;
                }
                //document.getElementById('list').insertBefore(span, null);
            };
        })(f);

        // Read in the file
        //reader.readAsDataText(f,UTF-8);
        reader.readAsText(f);
    }
    //xmlDoc.getElementsByTagName("distributome").item(0).appendChild(node);


    traverseXML(false, null, DistributomeXML_Objects, distributome.nodes, distributome.edges, distributome.references, distributomeNodes, referenceNodes);
}

I want to check if xmlDoc is valid. What would be a good way to do this without using print statements.

  • 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-04T14:25:40+00:00Added an answer on June 4, 2026 at 2:25 pm

    You can use the console and log variables content using the

    console.log("my variable content",variable);
    

    you can see it in the browser console using firebug or the native console of chrome or opera…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a C++ File class with read function, that is supposed to read
In my Java code I have function that gets file from the client in
I have a powershell script that needs to read from a config file with
I have a script that is supposed to read from the database and return
I have the following function that is supposed to trigger anytime one of the
I have a function that checks user input and wanted to know if it
Hey everyone, I have written a script that downloads a zip file from a
I'm trying to use java to read a string from a file that was
I have two functions that are supposed to encrypt and decrypt a string but
Suppose I have a function that returns a closure: sub generator { my $resource

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.