Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1251
  • Last Modified:

Refresh screen Javascript

I have a very big tree that Mozilla firefox can't contain. and the screen is not refreshing itself. when i use the horizontal scrollbar to see the other part of the tree it is no refreshed why.
0
dadadude
Asked:
dadadude
  • 4
  • 2
1 Solution
 
Michel PlungjanIT ExpertCommented:
show source or url
0
 
dadadudeAuthor Commented:
this is element1.js:
// JavaScript Document
//this gets you the XMLHTTP object
function getXMLhttp() {
      var C=null;
      try{
            C=new ActiveXObject("Msxml2.XMLHTTP");
      }catch(e){
            try{
                  C=new ActiveXObject("Microsoft.XMLHTTP");
            }catch(sc){
                  C=null;
            }
      }
      if(!C&&typeof XMLHttpRequest!="undefined"){
            C=new XMLHttpRequest();
      }
      return C;
}

// this calls a url and processes the xml
function ajax(){
url =  "http://localhost/phpXML/test.xml";
var request2 = getXMLhttp();
if (request2) {
      request2.open("GET", url, true);
      request2.onreadystatechange = function() {
      if (request2.readyState == 4 && request2.status == 200) {
            var xml = request2.responseXML;
            tableau = alert_ajax(xml,request2);
            CreateTree(tableau);
      }
};
request2.send(null);
}


}

function alert_ajax(docXML,request2){
   

      docXML= request2.responseXML;
      var items = docXML.getElementsByTagName("noeud");
      var tab = new Array(items.length);
      //on fait juste une boucle sur chaque élément "donnee" trouvé
      for (i = 0; i < items.length; i++){
            var position = items[i].getAttribute("id");
            var individus = items[i].getAttribute("individus");
            var variable =
items[i].getElementsByTagName("variable")[0].getAttribute("nom");
            var seuil = items[i].getElementsByTagName("seuil")[0].getAttribute("valeur");
            var element = new Element(position, individus, variable, seuil);
            tab[i] = element;
            //alert(position + ", " + individus + ", " + variable + ", " + seuil);
      }      
      return tab;

}

function CreateTree(tableau) {        
                        myTree = new ECOTree('myTree','myTreeContainer');      
                        for(i = 0; i < tableau.length; i++){
                              if(tableau[i].position == 1){
                                    myTree.add(tableau[i].position, -1, "Nombre Individus = "+tableau[i].individus, 150, 30, "#CCCCFF", "blue", "javascript:popup('detail.html','Détails Matrice','600','500')");      
                              }else{
                                    if(tableau[i].position%2 == 0){
                                          myTree.add(tableau[i].position, tableau[i].position/2, "Nombre Individus = "+tableau[i].individus, 150, 30, "#CCCCFF", "blue", "javascript:popup('detail.html','Détails Matrice','600','500')");
                                    }else{
                                          myTree.add(tableau[i].position, ((tableau[i].position)-1)/2, "Nombre Individus = "+tableau[i].individus, 150, 30, "#CCCCFF", "blue", "javascript:popup('detail.html','Détails Matrice','600','500')");
                                    }
                              }      
                        }            
                        myTree.UpdateTree();
                  }      



function Element(position, individus, variable, seuil){      
      this.position = position;
      this.individus = individus;
      this.variable = variable;
      this.seuil = seuil;
}

And this is Index.php
<html>
      <head>
            <title>Arbre Régression</title>
            <script type="text/javascript" src="ECOTree.js"></script>
            <script type="text/javascript" src="element1.js"></script>
            <link type="text/css" rel="stylesheet" href="ECOTree.css" />
            <script>
                  ajax();                  
                    
            </script>                  
      </head>
      <body onload="ajax();">
            <h4>Arbre Régression - Sanofi Pasteur</h4>
            <div id="myTreeContainer">
            </div>
      </body>
</html>
0
 
Michel PlungjanIT ExpertCommented:
Please go here
http://ee-stuff.com/

Please zip and upload

ECOTree.js
element1.js
ECOTree.css
Index.php
and
test.xml
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
dadadudeAuthor Commented:
ok Done.
Your file has successfully been uploaded!
To download the file, you must be logged into EE-Stuff. Here are two pages that will display your file, if logged in:

View all files for Question ID: 22709395
https://filedb.experts-exchange.com/incoming/ee-stuff/4075-index.zip 

Direct link to your file
https://filedb.experts-exchange.com/incoming/ee-stuff/4075-index.zip 
0
 
Michel PlungjanIT ExpertCommented:
<canvas id="ECOTreecanvas" width=2000 height=2000></canvas>

so FF is not happy with that.
It only renders to that position.
If we change it, the calculation goes wrong

I suggest you contact the makers. It is not obvious what to do here.
0
 
Michel PlungjanIT ExpertCommented:
Perhaps post a pointer question in CSS
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now