Refresh screen Javascript

Posted on 2007-07-20
Last Modified: 2016-08-29
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.
Question by:dadadude
    LVL 75

    Expert Comment

    by:Michel Plungjan
    show source or url

    Author Comment

    this is element1.js:
    // JavaScript Document
    //this gets you the XMLHTTP object
    function getXMLhttp() {
          var C=null;
                C=new ActiveXObject("Msxml2.XMLHTTP");
                      C=new ActiveXObject("Microsoft.XMLHTTP");
          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) {
"GET", url, true);
          request2.onreadystatechange = function() {
          if (request2.readyState == 4 && request2.status == 200) {
                var xml = request2.responseXML;
                tableau = alert_ajax(xml,request2);


    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 =
                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')");      
                                        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')");
                                              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')");

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

    And this is Index.php
                <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" />
          <body onload="ajax();">
                <h4>Arbre Régression - Sanofi Pasteur</h4>
                <div id="myTreeContainer">
    LVL 75

    Expert Comment

    by:Michel Plungjan
    Please go here

    Please zip and upload


    Author Comment

    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

    Direct link to your file
    LVL 75

    Expert Comment

    by:Michel Plungjan
    <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.
    LVL 75

    Accepted Solution

    Perhaps post a pointer question in CSS

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now