Ver Mensaje Individual
  #1 (permalink)  
Antiguo 09/05/2011, 15:17
Avatar de PabloPF
PabloPF
 
Fecha de Ingreso: mayo-2011
Ubicación: Ciudadano de un lugar llamado mundo!
Mensajes: 137
Antigüedad: 13 años
Puntos: 5
Problema con javascript en php

Este es el codigo:
Código PHP:
Ver original
  1. <?php
  2. include("conexion.php");
  3. ' . $_SESSION['usuario'] . '
  4. user_login();
  5.  
  6. echo '<meta http-equiv="Refresh" content="5;url=perfil.php"> ';
  7. echo' <html>
  8. <head>
  9. <style type="text/css">/*Container*/  
  10.    .progress-bar {  
  11.        border: 1px solid #56577A;  
  12.  
  13.        width: 200px;  
  14.        margin: 5px;  
  15.        padding: 1px;  
  16.        background: #fff;  
  17.        float: left;  
  18.  -moz-border-radius:5px 5px 5px 5px;
  19.  -ms-border-radius: 5px 5px 5px 5px;
  20.  -webkit-border-radius: 5px 5px 5px 5px;
  21.  border-radius: 5px 5px 5px 5px;
  22.    }  
  23.      
  24.  
  25.    .bar {  
  26.        height: 15px;  
  27.        font-size: 11px;  
  28.        
  29.        text-indent:-9000px;  
  30.  
  31.  -moz-border-radius:5px 5px 5px 5px;
  32.  -ms-border-radius: 5px 5px 5px 5px;
  33.  -webkit-border-radius: 5px 5px 5px 5px;
  34.  border-radius: 5px 5px 5px 5px;
  35.  
  36.    }  
  37. </style>
  38.      
  39.    <script type="text/javascript">  
  40.        window.onload = function() {initialize()}  
  41.  
  42. function initialize() {  
  43.        divId = "sample";  
  44.        thedivId = document.getElementById(divId);  
  45.        var percentage = thedivId.innerHTML;  
  46.  
  47.        thedivId.style.backgroundColor="#000";  
  48.        brim(divId,0,parseInt(percentage.substr(0, percentage.length-1)));  
  49.    }  
  50.    function brim(Id,start,percentage) {  
  51.        if (document.getElementById) {  
  52.             o = document.getElementById(Id);  
  53.                 if (start <= percentage) {  
  54.                    setWidth(o, start);  
  55.                    start += 1;  
  56.                    //Show progression percentage near the progress bar  
  57.                    document.getElementById("percentage").innerHTML = (start -1) + "%";  
  58.                    window.setTimeout("brim('"+Id+"',"+start+","+percentage+")", 50);  
  59.                 }  
  60.       }  
  61.    }  
  62.      
  63.    function setWidth(o, start) {  
  64.        o.style.width = start+"%";  
  65.    }  
  66.    </script>      
  67. </head>
  68. <body>
  69. <div class="progress-bar" >  
  70.        <div id ="sample" class="bar">100%</div>  
  71.    </div>  
  72.    <div id ="percentage"></div>  
  73. </body>
  74. </head>';
  75. ?>

el problema es que no me funciona el script
cual es el fallo?