[Webkit-unassigned] [Bug 85546] New: Javascript doesn't do nothing before the end of the entire script!

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu May 3 14:56:36 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=85546

           Summary: Javascript doesn't do nothing before the end of the
                    entire script!
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: teoteoteoteo87 at libero.it


Javascript doesn't do nothing before the end of the entire script!

If I try to execute the function prova() from the following simple code, it prints only the variable "risultato" without showing people the image attendi.gif!
In other browser, like Mozilla, it shows the image during the XmlHttpObject ... waiting, and when it receives the result it substitutes the image with the result!

function GetXmlHttpObject()
{
    var objXMLHttp=null;
    if (window.XMLHttpRequest)
    {
        objXMLHttp=new XMLHttpRequest();
    }
    else if (window.ActiveXObject)
    {
        objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    return objXMLHttp;
}

function prova()
{
    var newdiv = document.createElement("div");
        newdiv.setAttribute('id', 'extra');
        var vecchio = document.getElementById('extra');
        vecchio.parentNode.replaceChild(newdiv,vecchio);

                var newimg = document.createElement("img");
                var src='images/attendi.gif?'+variab;newimg.setAttribute('src', src);
                newimg.setAttribute('alt', 'Attendi ...');
                document.getElementById('extra').appendChild(newimg);
    }
    var xmlHttp = GetXmlHttpObject();
    var i=0;

    var url="http://www.mysite.com/script.php";

        if (!xmlHttp)
        {
            alert ("Browser does not support HTTP Request");
            return;
        }
        xmlHttp.open("GET", url, false);
        xmlHttp.send(null);
        var risposta=xmlHttp.responseText;
        risposta = risposta.replace("<","<");
        risposta = risposta.replace(">",">");
        if (risposta=='bye')
        {
            risultato="YES";
        }
        else
        {
            risultato="NO";
        }

        var newdiv = document.createElement("div");
        newdiv.setAttribute('id', 'extra');
        var vecchio = document.getElementById('extra');
        vecchio.parentNode.replaceChild(newdiv,vecchio);
        var newgrassetto = document.createElement("b");
        newgrassetto.setAttribute("style","color:red;");
        newgrassetto.innerHTML=risultato;
        document.getElementById("extra").appendChild(newgrassetto);

}

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list