Hi,

I used the following html to serve a qooxdoo app. It works fine in 
chrome, but doesn't work in ff 3.5. Basically, I'm trying to show a 
progress text for the qooxdoo build js file. The file is fetched ok and 
when I add the js node, it works fine in chrome, but in ff, nothing 
happens and no errors/warnings in firebug.

Any one know where I'm going wrong?

> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
> <html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en-us">
> <head>
>   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
>   <title>testproject</title>
>   <script type="text/javascript">
>     //<![CDATA[
>     window.onload =
>        
>       //load the js now
>       function() {
>         var app_js = "/testproject/build/script/testproject.js";
>         var head = document.getElementsByTagName('head')[0];
>         var body = document.getElementsByTagName("body")[0];
>         var progress = document.getElementById('progress');
>         var nojs = document.getElementById("nojs");
>         var js_app = "";
>         var js_element;
>         var cur_size = 0;
>         var js_req = new XMLHttpRequest();
>         var percent = 0;
>         var js = 0;
>         var size = 0;
>         var progress_text = "";
>
>         js_req.open("GET", app_js, true);
>         js_req.onreadystatechange = function() {
>           //3, the partial progress state will occur more times, so 
> check it first
>           if (js_req.readyState == 3)  {
>             cur_size = js_req.responseText.length || 0;
>             if(size == 0){
>               size = 
> parseInt(js_req.getResponseHeader("Content-Length")) || 0;
>               console.log("App size is " + size + " ...");
>             }
>             percent = parseInt(cur_size/size * 100);
>             progress_text  = "App loaded " + percent + "% " + cur_size 
> + " of " + size + " bytes ...";
>             //console.log("Current progress text content is: " + 
> progress.textContent + " ...");
>             progress.textContent = progress_text;
>             return;
>           } else if(js_req.readyState == 4)  { //4 means complete
>             if(size == 0){
>               size = 
> parseInt(js_req.getResponseHeader("Content-Length")) || 0;
>               console.log("App size is " + size + " ...");
>             }
>             console.log("App load request completed with status " + 
> js_req.status + " ...");
>             clearTimeout(jsTimer);
>             if (js_req.status == 200)  {
>               console.log("Fully loaded app " + cur_size + " of " + 
> size + " bytes ...");
>               //remove the progress div
>               body.removeChild(progress);
>               body.removeChild(nojs);
>               js_app = js_req.responseText;
>               js_element = document.createElement('script');
>               js_element.type = 'text/javascript';
>               js_element.text = js_app;
>               js_element.id = "dyn_js"
>               //js_element.src = app_js;
>               head.appendChild(js_element);
>               //res = eval(js_app);
>               //console.log("Eval res is " + res + " ...");
>               return;
>             } else { //loaded part
>               console.log("Error in loading js!!! Status is:" + 
> js_req.status + " ...");
>               return;
>             }
>           } else { //not complete yet
>             return;
>           } //else part
>         };
>         console.log("Sending app request ...");
>         var jsTimer = setTimeout(function() {
>           console.log("Aboring app loading request due to time out!!!");
>           js_req.abort();
>         }, 10000);
>         js_req.send(); //send it, NOW
>       }
>       //]]>
>   </script>
>   </head>
> <body>
>   <div id="nojs">
>     <!--
>     <noscript>
>       <center><b>Javascript disabled or not supported!!! Please enable 
> javascript in your browser!!!</b></center>
>     </noscript>
>     -->
>   </div>
>   <div id="progress">Loading application ...</div>
> </body>
> </html>

cheers,
skar.

-- 
--
The life so short, the craft so long to learn. 


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to