Foros del Web » Programando para Internet » Javascript » Frameworks JS »

Problemas de coma ,parentesis o llaves

Estas en el tema de Problemas de coma ,parentesis o llaves en el foro de Frameworks JS en Foros del Web. Hola Amigos estoy teniendo un problema con ie me pone el siguiente error Se esperaba un identificador ,una cadena o un numero en la linea ...
  #1 (permalink)  
Antiguo 12/09/2011, 08:19
 
Fecha de Ingreso: octubre-2010
Ubicación: Buenos Aires
Mensajes: 557
Antigüedad: 13 años, 6 meses
Puntos: 4
Problemas de coma ,parentesis o llaves

Hola Amigos estoy teniendo un problema con ie
me pone el siguiente error
Se esperaba un identificador ,una cadena o un numero
en la linea 34
mi codigo es este:
Código Javascript:
Ver original
  1. $(document).ready(function(){
  2.     $("#submitmsg").click(function(){  
  3.         var clientmsg = $("#usermsg").val();
  4.         $.post("post.php",{text:clientmsg});               
  5.         $("#usermsg").val("");
  6.         $("#usermsg").focus();
  7.         return false
  8.    
  9.     });
  10.     function loadLog(){    
  11.          var oldscrollHeight = $("#chatbox")[0].scrollHeight;
  12.         $.ajax({
  13.             url: "log.html",
  14.             cache: false,
  15.             success: function(html){       
  16.                 $("#chatbox").html(html); //Insert chat log into the #chatbox div              
  17.                 var newscrollHeight = $("#chatbox")[0].scrollHeight;
  18.                 if(newscrollHeight > oldscrollHeight){
  19.                     $("#chatbox").animate({ scrollTop: newscrollHeight }, 'normal'); //Autoscroll to bottom of div
  20.                 }      
  21.             },
  22.         });
  23.     }
  24.    
  25.     setInterval (loadLog, 2500);   
  26.    
  27.    
  28. });
seguro me esta faltando una coma o una llave pero no se en donde
agradezco mucho su ayuda
Saludos
  #2 (permalink)  
Antiguo 12/09/2011, 08:29
 
Fecha de Ingreso: octubre-2010
Ubicación: Buenos Aires
Mensajes: 557
Antigüedad: 13 años, 6 meses
Puntos: 4
Respuesta: Problemas de coma ,parentesis o llaves

LISTO!!!
el error estaba aca
Código Javascript:
Ver original
  1. $(document).ready(function(){
  2.     $("#submitmsg").click(function(){  
  3.         var clientmsg = $("#usermsg").val();
  4.         $.post("post.php",{text:clientmsg});                
  5.         $("#usermsg").val("");
  6.         $("#usermsg").focus();
  7.         return false
  8.    
  9.     });
  10.     function loadLog(){    
  11.          var oldscrollHeight = $("#chatbox")[0].scrollHeight;
  12.         $.ajax({
  13.             url: "log.html",
  14.             cache: false,
  15.             success: function(html){        
  16.                 $("#chatbox").html(html); //Insert chat log into the #chatbox div              
  17.                 var newscrollHeight = $("#chatbox")[0].scrollHeight;
  18.                 if(newscrollHeight > oldscrollHeight){
  19.                     $("#chatbox").animate({ scrollTop: newscrollHeight }, 'normal'); //Autoscroll to bottom of div
  20.                 }      
  21.             },  //[B][/B]esta coma esta demas
  22.         });
  23.     }
  24.    
  25.     setInterval (loadLog, 2500);    
  26.    
  27.    
  28. });
saludos y gracias
  #3 (permalink)  
Antiguo 12/09/2011, 08:30
Avatar de Aijoona
Colaborador
 
Fecha de Ingreso: mayo-2011
Ubicación: Buenos Aires
Mensajes: 779
Antigüedad: 12 años, 11 meses
Puntos: 343
Respuesta: Problemas de coma ,parentesis o llaves

Pegale un vistazo a esta herramienta (JSHint), te va a ser de mucha ayuda.
__________________
blog | @aijoona
  #4 (permalink)  
Antiguo 12/09/2011, 08:33
 
Fecha de Ingreso: octubre-2010
Ubicación: Buenos Aires
Mensajes: 557
Antigüedad: 13 años, 6 meses
Puntos: 4
Respuesta: Problemas de coma ,parentesis o llaves

buenisimo gracias

Etiquetas: ajax, coma, html, llaves, php
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 07:58.