Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 6 of 6
  1. #1
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default Anyone know whats wrong?

    Im trying out some AJAX to refresh the site stats on HabboSoft.com and so far i have

    HTML Code:
    <script type="text/javascript">
    function createRequestObject() {
         var ro;
         var browser = navigator.appName;
         if(browser == "Microsoft Internet Explorer"){
              ro = new ActiveXObject("Microsoft.XMLHTTP");
         }else{
              ro = new XMLHttpRequest();
         }
         return ro;
     
      var http = createRequestObject();
    }
    function handleResponse() {
     if(http.readyState==4)
     {
     response = http.responseText;
     document.getElementById("sitestats").innerHTML = response;
     }
    }
    function checkonline() {
     http.open('get','online/index.php');
     http.onreadystatechange = handleResponse;
     http.send(null);
    }
    setInterval("checkonline()",30000);
    </script>
    However, it has an error icon and doesnt work at all..

    Does anyone know how to fix?
    Coming and going...
    Highers are getting the better of me

  2. #2
    Join Date
    May 2007
    Location
    Nebo, NC, USA
    Posts
    2,517
    Tokens
    0

    Latest Awards:

    Default

    Download http://script.aculo.us/

    Include it in your page,

    Code:
    	<script type="text/javascript" src="js/prototype.js"></script>
    	<script type="text/javascript" src="js/scriptaculous.js"></script>
    Then:

    Code:
        <script type="text/javascript">
    
        function update()
        {
        	new Ajax.Updater('sitestats', 'online/index.php');
        }
    
        update();
        setInterval("update()",30000)
    	</script>

  3. #3
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default

    oooh ty caleb
    Coming and going...
    Highers are getting the better of me

  4. #4
    Join Date
    May 2007
    Location
    Nebo, NC, USA
    Posts
    2,517
    Tokens
    0

    Latest Awards:

    Default

    Its an easy way to do things, you can also do effects with it =] Etc.

    Or


    Code:
        <script type="text/javascript">
    
        function update(div, page)
        {
        	new Ajax.Updater(div, page);
        }
    	</script>
    	
    	<div id="sitestats"></div>
    	<div id="information"></div>
    	<a href="#" onclick="update('sitestats', 'online/index.php');">Update Stats</a>
    	<a href="#" onclick="update('information', 'information/index.php');">Update Information DIV</a>
    Just cool stuff

  5. #5
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default

    Ty

    Always known about scriptaculous just never known how to work it

    Any good TUTs?
    Coming and going...
    Highers are getting the better of me

  6. #6
    Join Date
    May 2007
    Location
    Nebo, NC, USA
    Posts
    2,517
    Tokens
    0

    Latest Awards:

    Default

    Not really, its pretty easy to learn.

    Read up on the Scriptaculous WIKI on their site :]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •