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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:43:13+00:00 2026-06-06T18:43:13+00:00

I have a some code to ajax upload . its send request to my

  • 0

I have a some code to ajax upload . its send request to my servlet and all works fine. But code contains a progress bar what i no need. Can u help me delete lines what i no need?
Another question how to refresh DIV with my content after upload files? When i use this code to send parametrs to jsp page

$.post(
            "deletePoly.jsp",
            {ids:ch.toString()},
           function(per){
          $("#WRAPlist").load("listing.jsp");
            }
          );

Where i gonn put line

$("#WRAPlist").load("listing.jsp");

this is upload code

var req;

    function ajaxFunction()
    {
        var url = "Upload_Servlet";

        if (window.XMLHttpRequest) // Non-IE browsers
        { 
            req = new XMLHttpRequest();
            req.onreadystatechange = processStateChange;

            try 
            {
                req.open("GET", url, true);
            } 
            catch (e) 
            {
                alert(e);
            }
            req.send(null);
        } 
        else if (window.ActiveXObject) // IE Browsers
        { 
            req = new ActiveXObject("Microsoft.XMLHTTP");

            if (req) 
            {
                req.onreadystatechange = processStateChange;
                req.open("GET", url, true);
                req.send();
            }
        }
    }

    function processStateChange()
    {

         *  State   Description
         *  0       The request is not initialized
         *  1       The request has been set up
         *  2       The request has been sent
         *  3       The request is in process
         *  4       The request is complete

        if (req.readyState == 4)
        {
            if (req.status == 200) // OK response
            {
                var xml = req.responseXML;

                // No need to iterate since there will only be one set of lines
                var isNotFinished = xml.getElementsByTagName("finished")[0];
                var myBytesRead = xml.getElementsByTagName("bytes_read")[0];
                var myContentLength = xml.getElementsByTagName("content_length")[0];
                var myPercent = xml.getElementsByTagName("percent_complete")[0];

                // Check to see if it's even started yet
                if ((isNotFinished == null) && (myPercent == null))
                {
                    document.getElementById("initializing").style.visibility = "visible";

                    // Sleep then call the function again
                    window.setTimeout("ajaxFunction();", 100);
                }
                else 
                {
                    document.getElementById("initializing").style.visibility = "hidden";
                    document.getElementById("progressBarTable").style.visibility = "visible";
                    document.getElementById("percentCompleteTable").style.visibility = "visible";
                    document.getElementById("bytesRead").style.visibility = "visible";

                    myBytesRead = myBytesRead.firstChild.data;
                    myContentLength = myContentLength.firstChild.data;

                    if (myPercent != null) // It's started, get the status of the upload
                    {
                        myPercent = myPercent.firstChild.data;

                        document.getElementById("progressBar").style.width = myPercent + "%";
                        document.getElementById("bytesRead").innerHTML = myBytesRead + " of " + 
                            myContentLength + " bytes read";
                        document.getElementById("percentComplete").innerHTML = myPercent + "%";

                        // Sleep then call the function again
                        window.setTimeout("ajaxFunction();", 100);
                    }
                    else
                    {
                        document.getElementById("bytesRead").style.visibility = "hidden";
                        document.getElementById("progressBar").style.width = "100%";
                        document.getElementById("percentComplete").innerHTML = "Done!";
                    }
                }
            }
            else
            {
                alert(req.statusText);
            }
        }

    }
  • 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-06T18:43:15+00:00Added an answer on June 6, 2026 at 6:43 pm

    remove these line of codes then it will not display progressbar..

    document.getElementById("initializing").style.visibility = "hidden";
    document.getElementById("progressBarTable").style.visibility = "visible";
    document.getElementById("percentCompleteTable").style.visibility = "visible";
    document.getElementById("bytesRead").style.visibility = "visible";
    
    myBytesRead = myBytesRead.firstChild.data;
    myContentLength = myContentLength.firstChild.data;
    
    if (myPercent != null) // It's started, get the status of the upload
    {
       myPercent = myPercent.firstChild.data;
       document.getElementById("progressBar").style.width = myPercent + "%";
       document.getElementById("bytesRead").innerHTML = myBytesRead + " of " + 
                                myContentLength + " bytes read";
       document.getElementById("percentComplete").innerHTML = myPercent + "%";
    
       // Sleep then call the function again
       window.setTimeout("ajaxFunction();", 100);
       }
       else
       {
         document.getElementById("bytesRead").style.visibility = "hidden";
         document.getElementById("progressBar").style.width = "100%";
         document.getElementById("percentComplete").innerHTML = "Done!";
       }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written some jQuery ajax code where I am sending a request to
I have some simple ajax code. All I want to do is load a
I have some jquery code that is doing an ajax lookup and returning comma
I have java script code to set some of the properties of ajax controls.
I have some code which adds a tooltip to all links. Now, the page
have a problem with my ajax code. I have some links and a content
I have a textarea: <textarea id=my_text></textarea> And have some ajax code in javascript like
I have some tricky AJAX code on a form, and sometimes it will fail
I have some ajax code that executes on mouseclick. It calls a file called
I have this code which works. $.ajax({ type: GET, url: includes/process.php, data: captcha= +

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.