1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

javascript refresh help

Discussion in 'HTML & JavaScript' started by Icke87, Feb 18, 2010.

  1. Icke87

    Icke87 Newbie

    Joined:
    Jul 11, 2009
    Messages:
    22
    Likes Received:
    4
    Location:
    Germany
    hi
    i need some help with my site
    Code:
    http://leuphana.fryart.de/island/
    i whant when the visitor goes throw the university, that the right
    text refresh every 5 seconds where he is and give him some information
    about that exact place
    here is the index.php
    Code:
    <html>
    <head>
        <script type="text/javascript">         
                     
            var req = null;
            verzoegerung = 5000;
    
    
            // - Cookie Verwaltung Anfang -
            a = document.cookie;
            cookiename = a.substr(0,a.search('='));
            cookiewert = a.substr(a.search('=')+1,a.search(';'));
            if(cookiewert == '')
                {
                    cookiewert = a.substr(a.search('=')+1,a.length);
                } 
            // - Cookie Verwaltung Ende -
    
    
            
            function handlestatechange(){                            
                switch(req.readyState) 
    
                {                    
            case 4:                        
            if(req.status!=200) {                            
            alert("Fehler:"+req.status);                         
    
        }else{                              // Übergabefelder
    
            changestate = document.getElementById("user_id");                            
            group_id = document.getElementById("group_id");
    
                                            // Inhalt der angeforderten XML Datei                          
            xml = req.responseXML; 
            
            changestate_resp = xml.getElementsByTagName("change")[0];                            
            groupid_resp = xml.getElementsByTagName("group_id")[0];                    // Ausgabe der Ergebnisse 
            changestate.value = changestate_resp.firstChild.nodeValue;                            
            groupid.value = groupid_resp.firstChild.nodeValue;                        
    
        }
    
        break;                                
        default:                        
        return false;                    
        break;
    
    }            
    }
    
        function statusabfrage(){                          // Erstellen des Requests                                 
    
        try{
            req = new XMLHttpRequest();                
            }                
                catch (e){                    
                try{                        
                req = new ActiveXObject("Msxml2.XMLHTTP");                    
            }                     
                catch (e){                        
                try{                            
                req = new ActiveXObject("Microsoft.XMLHTTP");                        
            }                         
                catch (failed){                            
                req = null;                        
            }                    
                }                  
            }
        
            if (req == null)                      
            alert("Error creating request object!");          // anfrage erstellen (GET, url ist localhost,                  
                                                              // request ist asynchron)
                                                          
                var url = 'http://fryart.de/changestate.php?statusabfrage='
                    +document.getElementById("cookiewert").value;
            
                req.open("GET", url, true);                     // Beim abschliessen des request wird diese Funktion ausgeführt                
                req.onreadystatechange = handlestatechange;                    
                req.setRequestHeader("Content-Type",                                      
                                     "application/x-www-form-urlencoded");                
                req.send(null);
                }         
            
            
            
        </script>
    
        </head>
    
    
    
    <style type="text/css">
    body {
        background-image: url(standart.jpg);
        background-repeat: no-repeat;
        }
    -->
    </style>
    <title>Leuphana Island</title><body tracingsrc="standart.jpg" tracingopacity="100"><blockquote>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
    </blockquote>
    <table width="1200" border="0">
    <tr>
          <td width="850" height="626"><blockquote>
          
         
          <applet code=gui.Start archive="http://serv.fryart.de/island3.jar, http://serv.fryart.de/mysql-connector-java-5.1.10-bin.jar" width="700" height="700" alt="test" title="test" mayscript>
         </applet>
    
                    
          </blockquote></td>
        <td width="372" valign="top">
        
        <img src="title.png" alt="Title" width="400" height="100" longdesc="http://leuphana.fryart.de/island/title.png">
        
        <?php
        require_once("dbconnect.php");                        // Datenbank Verbindung
        require_once("config.inc.php");
            
                
                // iframe aus crosslink.php generieren
                // Variable $user übergeben
                
                // <body onLoad=\"refreshing()\">
                
            echo "    
            
    
            <iframe allowtransparancy=\"true\" scrolling=\"no\" src=\"http://leuphana.fryart.de/island/crosslink.php?user=".$user."\" 
            onLoad=\"setTimeout('statusabfrage()', verzoegerung)\" frameborder=\"0\" width=\"100%\" height=\"600\" name=\"content in a box\">                        
        
        
        
            <META HTTP-EQIV=\"Expires\" CONTENT=\"0\">
            <META HTTP-EQIV=\"Pragma\" CONTENT=\"no-cache\">
            <META HTTP-EQIV=\"Cache-Control\" CONTENT=\"no-cache\">
            
        </iframe></td>
        
        
        
      </tr>
    </table></html>
    </html>"
    ;
    ?>
     
  2. eshera

    eshera Registered Member

    Joined:
    Nov 13, 2008
    Messages:
    58
    Likes Received:
    108
    Your page is 403