Foros del Web » Programando para Internet » Javascript »

problemas con un chat

Estas en el tema de problemas con un chat en el foro de Javascript en Foros del Web. Buenas tengo un problema tengo un chat que me guarda el nombre del usuario que abla en vez del id, si cambio para que me ...
  #1 (permalink)  
Antiguo 25/08/2012, 04:49
 
Fecha de Ingreso: noviembre-2011
Mensajes: 516
Antigüedad: 12 años, 5 meses
Puntos: 10
problemas con un chat

Buenas tengo un problema tengo un chat que me guarda el nombre del usuario que abla en vez del id, si cambio para que me guarde el id ya no me sale el nombre en el chat sino este id, este es mi codigo aber si me podeis ayudar y dar ideas de como modificarlo:
chat.php
Código PHP:
Ver original
  1. <?php
  2. define ('DBPATH','localhost');
  3. define ('DBUSER','root');
  4. define ('DBPASS','pass');
  5. define ('DBNAME','muroredsocial');
  6.  
  7.  
  8. global $dbh;
  9. $dbh = mysql_connect(DBPATH,DBUSER,DBPASS);
  10. mysql_selectdb(DBNAME,$dbh);
  11.  
  12. if ($_GET['action'] == "chatheartbeat") { chatHeartbeat(); }
  13. if ($_GET['action'] == "sendchat") { sendChat(); }
  14. if ($_GET['action'] == "closechat") { closeChat(); }
  15. if ($_GET['action'] == "startchatsession") { startChatSession(); }
  16.  
  17. if (!isset($_SESSION['chatHistory'])) {
  18.     $_SESSION['chatHistory'] = array();
  19. }
  20.  
  21. if (!isset($_SESSION['openChatBoxes'])) {
  22.     $_SESSION['openChatBoxes'] = array();  
  23. }
  24.  
  25. function chatHeartbeat() {
  26.    
  27.     $sql = "select * from chat where (chat.to = '".mysql_real_escape_string($_SESSION['logueado_nombre'])."' AND recd = 0) order by id ASC";
  28.     $query = mysql_query($sql);
  29.     $items = '';
  30.  
  31.     $chatBoxes = array();
  32.  
  33.     while ($chat = mysql_fetch_array($query)) {
  34.  
  35.         if (!isset($_SESSION['openChatBoxes'][$chat['from']]) && isset($_SESSION['chatHistory'][$chat['from']])) {
  36.             $items = $_SESSION['chatHistory'][$chat['from']];
  37.         }
  38.  
  39.         $chat['message'] = sanitize($chat['message']);
  40.  
  41.         $items .= <<<EOD
  42.                        {
  43.             "s": "0",
  44.             "f": "{$chat['from']}",
  45.             "m": "{$chat['message']}"
  46.        },
  47. EOD;
  48.  
  49.     if (!isset($_SESSION['chatHistory'][$chat['from']])) {
  50.         $_SESSION['chatHistory'][$chat['from']] = '';
  51.     }
  52.  
  53.     $_SESSION['chatHistory'][$chat['from']] .= <<<EOD
  54.                            {
  55.             "s": "0",
  56.             "f": "{$chat['from']}",
  57.             "m": "{$chat['message']}"
  58.        },
  59. EOD;
  60.        
  61.         unset($_SESSION['tsChatBoxes'][$chat['from']]);
  62.         $_SESSION['openChatBoxes'][$chat['from']] = $chat['sent'];
  63.     }
  64.  
  65.     if (!empty($_SESSION['openChatBoxes'])) {
  66.     foreach ($_SESSION['openChatBoxes'] as $chatbox => $time) {
  67.         if (!isset($_SESSION['tsChatBoxes'][$chatbox])) {
  68.             $now = time()-strtotime($time);
  69.             $time = date('g:iA M dS', strtotime($time));
  70.  
  71.             $message = "Sent at $time";
  72.             if ($now > 180) {
  73.                 $items .= <<<EOD
  74. {
  75. "s": "2",
  76. "f": "$chatbox",
  77. "m": "{$message}"
  78. },
  79. EOD;
  80.  
  81.     if (!isset($_SESSION['chatHistory'][$chatbox])) {
  82.         $_SESSION['chatHistory'][$chatbox] = '';
  83.     }
  84.  
  85.     $_SESSION['chatHistory'][$chatbox] .= <<<EOD
  86.         {
  87. "s": "2",
  88. "f": "$chatbox",
  89. "m": "{$message}"
  90. },
  91. EOD;
  92.             $_SESSION['tsChatBoxes'][$chatbox] = 1;
  93.         }
  94.         }
  95.     }
  96. }
  97.  
  98.     $sql = "update chat set recd = 1 where chat.to = '".mysql_real_escape_string($_SESSION['logueado_nombre'])."' and recd = 0";
  99.     $query = mysql_query($sql);
  100.  
  101.     if ($items != '') {
  102.         $items = substr($items, 0, -1);
  103.     }
  104. header('Content-type: application/json');
  105. ?>
  106. {
  107.         "items": [
  108.             <?php echo $items;?>
  109.         ]
  110. }
  111.  
  112. <?php
  113.             exit(0);
  114. }
  115.  
  116. function chatBoxSession($chatbox) {
  117.    
  118.     $items = '';
  119.    
  120.     if (isset($_SESSION['chatHistory'][$chatbox])) {
  121.         $items = $_SESSION['chatHistory'][$chatbox];
  122.     }
  123.  
  124.     return $items;
  125. }
  126.  
  127. function startChatSession() {
  128.     $items = '';
  129.     if (!empty($_SESSION['openChatBoxes'])) {
  130.         foreach ($_SESSION['openChatBoxes'] as $chatbox => $void) {
  131.             $items .= chatBoxSession($chatbox);
  132.         }
  133.     }
  134.  
  135.  
  136.     if ($items != '') {
  137.         $items = substr($items, 0, -1);
  138.     }
  139.  
  140. header('Content-type: application/json');
  141. ?>
  142. {
  143.         "username": "<?php echo $_SESSION['logueado_nombre'];?>",
  144.         "items": [
  145.             <?php echo $items;?>
  146.         ]
  147. }
  148.  
  149. <?php
  150.  
  151.  
  152.     exit(0);
  153. }
  154.  
  155. function sendChat() {
  156.     $from = $_SESSION['logueado_nombre'];
  157.     $to = $_POST['to'];
  158.     $message = $_POST['message'];
  159.  
  160.     $_SESSION['openChatBoxes'][$_POST['to']] = date('Y-m-d H:i:s', time());
  161.    
  162.     $messagesan = sanitize($message);
  163.  
  164.     if (!isset($_SESSION['chatHistory'][$_POST['to']])) {
  165.         $_SESSION['chatHistory'][$_POST['to']] = '';
  166.     }
  167.  
  168.     $_SESSION['chatHistory'][$_POST['to']] .= <<<EOD
  169.                        {
  170.             "s": "1",
  171.             "f": "{$to}",
  172.             "m": "{$messagesan}"
  173.        },
  174. EOD;
  175.  
  176.  
  177.     unset($_SESSION['tsChatBoxes'][$_POST['to']]);
  178.  
  179.     $sql = "insert into chat (chat.from,chat.to,message,sent) values ('".mysql_real_escape_string($from)."', '".mysql_real_escape_string($to)."','".mysql_real_escape_string($message)."',NOW())";
  180.     $query = mysql_query($sql);
  181.     echo "1";
  182.     exit(0);
  183. }
  184.  
  185. function closeChat() {
  186.  
  187.     unset($_SESSION['openChatBoxes'][$_POST['chatbox']]);
  188.    
  189.     echo "1";
  190.     exit(0);
  191. }
  192.  
  193. function sanitize($text) {
  194.     $text = htmlspecialchars($text, ENT_QUOTES);
  195.     $text = str_replace("\n\r","\n",$text);
  196.     $text = str_replace("\r\n","\n",$text);
  197.     $text = str_replace("\n","<br>",$text);
  198.     return $text;
  199. }
este es el que guardaria el id de cada usuario, el problema lo tengo en el ajax que muestra el chat.
  #2 (permalink)  
Antiguo 25/08/2012, 04:53
 
Fecha de Ingreso: noviembre-2011
Mensajes: 516
Antigüedad: 12 años, 5 meses
Puntos: 10
Respuesta: problemas con un chat

chat.js
Código Javascript:
Ver original
  1. var windowFocus = true;
  2. var username;
  3. var chatHeartbeatCount = 0;
  4. var minChatHeartbeat = 1000;
  5. var maxChatHeartbeat = 33000;
  6. var chatHeartbeatTime = minChatHeartbeat;
  7. var originalTitle;
  8. var blinkOrder = 0;
  9.  
  10. var chatboxFocus = new Array();
  11. var newMessages = new Array();
  12. var newMessagesWin = new Array();
  13. var chatBoxes = new Array();
  14.  
  15. $(document).ready(function(){
  16.     originalTitle = document.title;
  17.     startChatSession();
  18.  
  19.     $([window, document]).blur(function(){
  20.         windowFocus = false;
  21.     }).focus(function(){
  22.         windowFocus = true;
  23.         document.title = originalTitle;
  24.     });
  25. });
  26.  
  27. function restructureChatBoxes() {
  28.     align = 0;
  29.     for (x in chatBoxes) {
  30.         chatboxtitle = chatBoxes[x];
  31.  
  32.         if ($("#chatbox_"+chatboxtitle).css('display') != 'none') {
  33.             if (align == 0) {
  34.                 $("#chatbox_"+chatboxtitle).css('right', '20px');
  35.             } else {
  36.                 width = (align)*(225+7)+20;
  37.                 $("#chatbox_"+chatboxtitle).css('right', width+'px');
  38.             }
  39.             align++;
  40.         }
  41.     }
  42. }
  43.  
  44. function chatWith(chatuser) {
  45.     createChatBox(chatuser);
  46.     $("#chatbox_"+chatuser+" .chatboxtextarea").focus();
  47. }
  48.  
  49. function createChatBox(chatboxtitle,minimizeChatBox) {
  50.     if ($("#chatbox_"+chatboxtitle).length > 0) {
  51.         if ($("#chatbox_"+chatboxtitle).css('display') == 'none') {
  52.             $("#chatbox_"+chatboxtitle).css('display','block');
  53.             restructureChatBoxes();
  54.         }
  55.         $("#chatbox_"+chatboxtitle+" .chatboxtextarea").focus();
  56.         return;
  57.     }
  58.  
  59.     $(" <div />" ).attr("id","chatbox_"+chatboxtitle)
  60.     .addClass("chatbox")
  61.     .html('<div class="chatboxhead"><div class="chatboxtitle">'+chatboxtitle+'</div><div class="chatboxoptions"><a href="javascript:void(0)" onclick="javascript:toggleChatBoxGrowth(\''+chatboxtitle+'\')">-</a> <a href="javascript:void(0)" onclick="javascript:closeChatBox(\''+chatboxtitle+'\')">X</a></div><br clear="all"/></div><div class="chatboxcontent"></div><div class="chatboxinput"><textarea class="chatboxtextarea" onkeydown="javascript:return checkChatBoxInputKey(event,this,\''+chatboxtitle+'\');"></textarea></div>')
  62.     .appendTo($( "body" ));
  63.                
  64.     $("#chatbox_"+chatboxtitle).css('bottom', '0px');
  65.    
  66.     chatBoxeslength = 0;
  67.  
  68.     for (x in chatBoxes) {
  69.         if ($("#chatbox_"+chatBoxes[x]).css('display') != 'none') {
  70.             chatBoxeslength++;
  71.         }
  72.     }
  73.  
  74.     if (chatBoxeslength == 0) {
  75.         $("#chatbox_"+chatboxtitle).css('right', '20px');
  76.     } else {
  77.         width = (chatBoxeslength)*(225+7)+20;
  78.         $("#chatbox_"+chatboxtitle).css('right', width+'px');
  79.     }
  80.    
  81.     chatBoxes.push(chatboxtitle);
  82.  
  83.     if (minimizeChatBox == 1) {
  84.         minimizedChatBoxes = new Array();
  85.  
  86.         if ($.cookie('chatbox_minimized')) {
  87.             minimizedChatBoxes = $.cookie('chatbox_minimized').split(/\|/);
  88.         }
  89.         minimize = 0;
  90.         for (j=0;j<minimizedChatBoxes.length;j++) {
  91.             if (minimizedChatBoxes[j] == chatboxtitle) {
  92.                 minimize = 1;
  93.             }
  94.         }
  95.  
  96.         if (minimize == 1) {
  97.             $('#chatbox_'+chatboxtitle+' .chatboxcontent').css('display','none');
  98.             $('#chatbox_'+chatboxtitle+' .chatboxinput').css('display','none');
  99.         }
  100.     }
  101.  
  102.     chatboxFocus[chatboxtitle] = false;
  103.  
  104.     $("#chatbox_"+chatboxtitle+" .chatboxtextarea").blur(function(){
  105.         chatboxFocus[chatboxtitle] = false;
  106.         $("#chatbox_"+chatboxtitle+" .chatboxtextarea").removeClass('chatboxtextareaselected');
  107.     }).focus(function(){
  108.         chatboxFocus[chatboxtitle] = true;
  109.         newMessages[chatboxtitle] = false;
  110.         $('#chatbox_'+chatboxtitle+' .chatboxhead').removeClass('chatboxblink');
  111.         $("#chatbox_"+chatboxtitle+" .chatboxtextarea").addClass('chatboxtextareaselected');
  112.     });
  113.  
  114.     $("#chatbox_"+chatboxtitle).click(function() {
  115.         if ($('#chatbox_'+chatboxtitle+' .chatboxcontent').css('display') != 'none') {
  116.             $("#chatbox_"+chatboxtitle+" .chatboxtextarea").focus();
  117.         }
  118.     });
  119.  
  120.     $("#chatbox_"+chatboxtitle).show();
  121. }
  122.  
  123.  
  124. function chatHeartbeat(){
  125.  
  126.     var itemsfound = 0;
  127.    
  128.     if (windowFocus == false) {
  129.  
  130.         var blinkNumber = 0;
  131.         var titleChanged = 0;
  132.         for (x in newMessagesWin) {
  133.             if (newMessagesWin[x] == true) {
  134.                 ++blinkNumber;
  135.                 if (blinkNumber >= blinkOrder) {
  136.                     document.title = x+' dice...';/* AKI ES LO DE ARRIBA DEL TITULO*/
  137.                     titleChanged = 1;
  138.                     break; 
  139.                 }
  140.             }
  141.         }
  142.        
  143.         if (titleChanged == 0) {
  144.             document.title = originalTitle;
  145.             blinkOrder = 0;
  146.         } else {
  147.             ++blinkOrder;
  148.         }
  149.  
  150.     } else {
  151.         for (x in newMessagesWin) {
  152.             newMessagesWin[x] = false;
  153.         }
  154.     }
  155.  
  156.     for (x in newMessages) {
  157.         if (newMessages[x] == true) {
  158.             if (chatboxFocus[x] == false) {
  159.                 //FIXME: add toggle all or none policy, otherwise it looks funny
  160.                 $('#chatbox_'+x+' .chatboxhead').toggleClass('chatboxblink');
  161.             }
  162.         }
  163.     }
  164.    
  165.     $.ajax({
  166.       url: "chat.php?action=chatheartbeat",
  167.       cache: false,
  168.       dataType: "json",
  169.       success: function(data) {
  170.  
  171.         $.each(data.items, function(i,item){
  172.             if (item)   { // fix strange ie bug
  173.  
  174.                 chatboxtitle = item.f;
  175.  
  176.                 if ($("#chatbox_"+chatboxtitle).length <= 0) {
  177.                     createChatBox(chatboxtitle);
  178.                 }
  179.                 if ($("#chatbox_"+chatboxtitle).css('display') == 'none') {
  180.                     $("#chatbox_"+chatboxtitle).css('display','block');
  181.                     restructureChatBoxes();
  182.                 }
  183.                
  184.                 if (item.s == 1) {
  185.                     item.f = username;
  186.                 }
  187.  
  188.                 if (item.s == 2) {
  189.                     $("#chatbox_"+chatboxtitle+" .chatboxcontent").append('<div class="chatboxmessage"><span class="chatboxinfo">'+item.m+'</span></div>');
  190.                 } else {
  191.                     newMessages[chatboxtitle] = true;
  192.                     newMessagesWin[chatboxtitle] = true;
  193.                     $("#chatbox_"+chatboxtitle+" .chatboxcontent").append('<div class="chatboxmessage"><span class="chatboxmessagefrom">'+item.f+':&nbsp;&nbsp;</span><span class="chatboxmessagecontent">'+item.m+'</span></div>');
  194.                 }
  195.  
  196.                 $("#chatbox_"+chatboxtitle+" .chatboxcontent").scrollTop($("#chatbox_"+chatboxtitle+" .chatboxcontent")[0].scrollHeight);
  197.                 itemsfound += 1;
  198.             }
  199.         });
  200.  
  201.         chatHeartbeatCount++;
  202.  
  203.         if (itemsfound > 0) {
  204.             chatHeartbeatTime = minChatHeartbeat;
  205.             chatHeartbeatCount = 1;
  206.         } else if (chatHeartbeatCount >= 10) {
  207.             chatHeartbeatTime *= 2;
  208.             chatHeartbeatCount = 1;
  209.             if (chatHeartbeatTime > maxChatHeartbeat) {
  210.                 chatHeartbeatTime = maxChatHeartbeat;
  211.             }
  212.         }
  213.        
  214.         setTimeout('chatHeartbeat();',chatHeartbeatTime);
  215.     }});
  216. }
  217.  
  218. function closeChatBox(chatboxtitle) {
  219.     $('#chatbox_'+chatboxtitle).css('display','none');
  220.     restructureChatBoxes();
  221.  
  222.     $.post("chat.php?action=closechat", { chatbox: chatboxtitle} , function(data){ 
  223.     });
  224.  
  225. }
  226.  
  227. function toggleChatBoxGrowth(chatboxtitle) {
  228.     if ($('#chatbox_'+chatboxtitle+' .chatboxcontent').css('display') == 'none') {  
  229.        
  230.         var minimizedChatBoxes = new Array();
  231.        
  232.         if ($.cookie('chatbox_minimized')) {
  233.             minimizedChatBoxes = $.cookie('chatbox_minimized').split(/\|/);
  234.         }
  235.  
  236.         var newCookie = '';
  237.  
  238.         for (i=0;i<minimizedChatBoxes.length;i++) {
  239.             if (minimizedChatBoxes[i] != chatboxtitle) {
  240.                 newCookie += chatboxtitle+'|';
  241.             }
  242.         }
  243.  
  244.         newCookie = newCookie.slice(0, -1)
  245.  
  246.  
  247.         $.cookie('chatbox_minimized', newCookie);
  248.         $('#chatbox_'+chatboxtitle+' .chatboxcontent').css('display','block');
  249.         $('#chatbox_'+chatboxtitle+' .chatboxinput').css('display','block');
  250.         $("#chatbox_"+chatboxtitle+" .chatboxcontent").scrollTop($("#chatbox_"+chatboxtitle+" .chatboxcontent")[0].scrollHeight);
  251.     } else {
  252.        
  253.         var newCookie = chatboxtitle;
  254.  
  255.         if ($.cookie('chatbox_minimized')) {
  256.             newCookie += '|'+$.cookie('chatbox_minimized');
  257.         }
  258.  
  259.  
  260.         $.cookie('chatbox_minimized',newCookie);
  261.         $('#chatbox_'+chatboxtitle+' .chatboxcontent').css('display','none');
  262.         $('#chatbox_'+chatboxtitle+' .chatboxinput').css('display','none');
  263.     }
  264.    
  265. }
  266.  
  267. function checkChatBoxInputKey(event,chatboxtextarea,chatboxtitle) {
  268.      
  269.     if(event.keyCode == 13 && event.shiftKey == 0)  {
  270.         message = $(chatboxtextarea).val();
  271.         message = message.replace(/^\s+|\s+$/g,"");
  272.  
  273.         $(chatboxtextarea).val('');
  274.         $(chatboxtextarea).focus();
  275.         $(chatboxtextarea).css('height','44px');
  276.         if (message != '') {
  277.             $.post("chat.php?action=sendchat", {to: chatboxtitle, message: message} , function(data){
  278.                 message = message.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;");
  279.                 $("#chatbox_"+chatboxtitle+" .chatboxcontent").append('<div class="chatboxmessage"><span class="chatboxmessagefrom">'+username+':&nbsp;&nbsp;</span><span class="chatboxmessagecontent">'+message+'</span></div>');
  280.                 $("#chatbox_"+chatboxtitle+" .chatboxcontent").scrollTop($("#chatbox_"+chatboxtitle+" .chatboxcontent")[0].scrollHeight);
  281.             });
  282.         }
  283.         chatHeartbeatTime = minChatHeartbeat;
  284.         chatHeartbeatCount = 1;
  285.  
  286.         return false;
  287.     }
  288.  
  289.     var adjustedHeight = chatboxtextarea.clientHeight;
  290.     var maxHeight = 94;
  291.  
  292.     if (maxHeight > adjustedHeight) {
  293.         adjustedHeight = Math.max(chatboxtextarea.scrollHeight, adjustedHeight);
  294.         if (maxHeight)
  295.             adjustedHeight = Math.min(maxHeight, adjustedHeight);
  296.         if (adjustedHeight > chatboxtextarea.clientHeight)
  297.             $(chatboxtextarea).css('height',adjustedHeight+8 +'px');
  298.     } else {
  299.         $(chatboxtextarea).css('overflow','auto');
  300.     }
  301.      
  302. }
  #3 (permalink)  
Antiguo 25/08/2012, 04:54
 
Fecha de Ingreso: noviembre-2011
Mensajes: 516
Antigüedad: 12 años, 5 meses
Puntos: 10
Respuesta: problemas con un chat

2 parte de chat.js
Código Javascript:
Ver original
  1. function startChatSession(){  
  2.     $.ajax({
  3.       url: "chat.php?action=startchatsession",
  4.       cache: false,
  5.       dataType: "json",
  6.       success: function(data) {
  7.  
  8.         username = data.username;
  9.  
  10.         $.each(data.items, function(i,item){
  11.             if (item)   { // fix strange ie bug
  12.  
  13.                 chatboxtitle = item.f;
  14.  
  15.                 if ($("#chatbox_"+chatboxtitle).length <= 0) {
  16.                     createChatBox(chatboxtitle,1);
  17.                 }
  18.                
  19.                 if (item.s == 1) {
  20.                     item.f = username;
  21.                 }
  22.  
  23.                 if (item.s == 2) {
  24.                     $("#chatbox_"+chatboxtitle+" .chatboxcontent").append('<div class="chatboxmessage"><span class="chatboxinfo">'+item.m+'</span></div>');
  25.                 } else {
  26.                     $("#chatbox_"+chatboxtitle+" .chatboxcontent").append('<div class="chatboxmessage"><span class="chatboxmessagefrom">'+item.f+':&nbsp;&nbsp;</span><span class="chatboxmessagecontent">'+item.m+'</span></div>');
  27.                 }
  28.             }
  29.         });
  30.        
  31.         for (i=0;i<chatBoxes.length;i++) {
  32.             chatboxtitle = chatBoxes[i];
  33.             $("#chatbox_"+chatboxtitle+" .chatboxcontent").scrollTop($("#chatbox_"+chatboxtitle+" .chatboxcontent")[0].scrollHeight);
  34.             setTimeout('$("#chatbox_"+chatboxtitle+" .chatboxcontent").scrollTop($("#chatbox_"+chatboxtitle+" .chatboxcontent")[0].scrollHeight);', 100); // yet another strange ie bug
  35.         }
  36.    
  37.     setTimeout('chatHeartbeat();',chatHeartbeatTime);
  38.        
  39.     }});
  40. }
  41.  
  42.  
  43. jQuery.cookie = function(name, value, options) {
  44.     if (typeof value != 'undefined') { // name and value given, set cookie
  45.         options = options || {};
  46.         if (value === null) {
  47.             value = '';
  48.             options.expires = -1;
  49.         }
  50.         var expires = '';
  51.         if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
  52.             var date;
  53.             if (typeof options.expires == 'number') {
  54.                 date = new Date();
  55.                 date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
  56.             } else {
  57.                 date = options.expires;
  58.             }
  59.             expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
  60.         }
  61.        
  62.         var path = options.path ? '; path=' + (options.path) : '';
  63.         var domain = options.domain ? '; domain=' + (options.domain) : '';
  64.         var secure = options.secure ? '; secure' : '';
  65.         document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
  66.     } else { // only name given, get cookie
  67.         var cookieValue = null;
  68.         if (document.cookie && document.cookie != '') {
  69.             var cookies = document.cookie.split(';');
  70.             for (var i = 0; i < cookies.length; i++) {
  71.                 var cookie = jQuery.trim(cookies[i]);
  72.                 if (cookie.substring(0, name.length + 1) == (name + '=')) {
  73.                     cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
  74.                     break;
  75.                 }
  76.             }
  77.         }
  78.         return cookieValue;
  79.     }
  80. };
Espero que me podais ayudar, un saludo, y gracias de antemano.
  #4 (permalink)  
Antiguo 25/08/2012, 06:04
 
Fecha de Ingreso: noviembre-2011
Mensajes: 516
Antigüedad: 12 años, 5 meses
Puntos: 10
Respuesta: problemas con un chat

e conseguido lo que estaba buscando pero tengo un problemilla al hablar a algien a ese algien le sale una caja de chat y de nombre pone indefinido, nose que error tengo el codigo es este:
Código Javascript:
Ver original
  1. var windowFocus = true;
  2. var username;
  3. var chatHeartbeatCount = 0;
  4. var minChatHeartbeat = 1000;
  5. var maxChatHeartbeat = 33000;
  6. var chatHeartbeatTime = minChatHeartbeat;
  7. var originalTitle;
  8. var blinkOrder = 0;
  9.  
  10. var chatboxFocus = new Array();
  11. var newMessages = new Array();
  12. var newMessagesWin = new Array();
  13. var chatBoxes = new Array();
  14.  
  15. $(document).ready(function(){
  16.     originalTitle = document.title;
  17.     startChatSession();
  18.  
  19.     $([window, document]).blur(function(){
  20.         windowFocus = false;
  21.     }).focus(function(){
  22.         windowFocus = true;
  23.         document.title = originalTitle;
  24.     });
  25. });
  26.  
  27.  
  28.  var RequestObject = false;
  29.    //directorio donde tenemos el archivo ajax.php
  30.   var Archivo = 'consulta_chat.php';
  31.  
  32.   // el tiempo X que tardará en actualizarse
  33.   window.setInterval("actualizacion_reloj()", 1000);
  34.  
  35.   if (window.XMLHttpRequest) RequestObject = new XMLHttpRequest();
  36.   if (window.ActiveXObject) RequestObject = new ActiveXObject("Microsoft.XMLHTTP");
  37.  
  38.   function ReqChange() {
  39.   // Si se ha recibido la información correctamente
  40.     if (RequestObject.readyState==4) {
  41.      // si la información es válida
  42.      if (RequestObject.responseText.indexOf('invalid') == -1) {
  43.      // Buscamos la div con id online
  44.        document.getElementById("cajon_chat").innerHTML = RequestObject.responseText;
  45.      } else {
  46.       // Por si hay algun error document.getElementById("online").innerHTML = "Error llamando";
  47.      }
  48.     }
  49.   }
  50.  
  51.   function llamadaAjax() {
  52.         // Mensaje a mostrar mientras se obtiene la información remota...
  53.     var previousContent = '';
  54.     // Preparamos la obtención de datos
  55.     RequestObject.open("GET", Archivo+"?"+Math.random() , true);
  56.     RequestObject.onreadystatechange = ReqChange;
  57.     // Enviamos
  58.     RequestObject.send(null);
  59.   }
  60.  
  61.   function actualizacion_reloj() {
  62.    llamadaAjax();
  63.  }
  64.  
  65.  
  66.  
  67. function restructureChatBoxes() {
  68.     align = 0;
  69.     for (x in chatBoxes) {
  70.         chatboxtitle = chatBoxes[x];
  71.  
  72.         if ($("#chatbox_"+chatboxtitle).css('display') != 'none') {
  73.             if (align == 0) {
  74.                 $("#chatbox_"+chatboxtitle).css('right', '20px');
  75.             } else {
  76.                 width = (align)*(225+7)+20;
  77.                 $("#chatbox_"+chatboxtitle).css('right', width+'px');
  78.             }
  79.             align++;
  80.         }
  81.     }
  82. }
  83.  
  84. function chatWith(chatuser, chatid) {
  85.     createChatBox(chatid, chatuser);
  86.     $("#chatbox_"+chatid+" .chatboxtextarea").focus();
  87. }
  88.  
  89. function createChatBox(chatid, chatboxtitle,minimizeChatBox) {
  90.     if ($("#chatbox_"+chatboxtitle).length > 0) {
  91.         if ($("#chatbox_"+chatboxtitle).css('display') == 'none') {
  92.             $("#chatbox_"+chatboxtitle).css('display','block');
  93.             restructureChatBoxes();
  94.         }
  95.         $("#chatbox_"+chatboxtitle+" .chatboxtextarea").focus();
  96.         return;
  97.     }
  98.  
  99.     $(" <div />" ).attr("id","chatbox_"+chatboxtitle)
  100.     .addClass("chatbox")
  101.     .html('<div class="chatboxhead"><div class="chatboxtitle">'+chatboxtitle+'</div><div class="chatboxoptions"><a href="javascript:void(0)" onclick="javascript:toggleChatBoxGrowth(\''+chatboxtitle+'\')">-</a> <a href="javascript:void(0)" onclick="javascript:closeChatBox(\''+chatboxtitle+'\')">X</a></div><br clear="all"/></div><div class="chatboxcontent"></div><div class="chatboxinput"><textarea class="chatboxtextarea" onkeydown="javascript:return checkChatBoxInputKey(event,this,\''+chatboxtitle+'\','+chatid+');"></textarea></div>')
  102.     .appendTo($( "body" ));
  103.                
  104.     $("#chatbox_"+chatboxtitle).css('bottom', '0px');
  105.    
  106.     chatBoxeslength = 0;
  107.  
  108.     for (x in chatBoxes) {
  109.         if ($("#chatbox_"+chatBoxes[x]).css('display') != 'none') {
  110.             chatBoxeslength++;
  111.         }
  112.     }
  113.  
  114.     if (chatBoxeslength == 0) {
  115.         $("#chatbox_"+chatboxtitle).css('right', '20px');
  116.     } else {
  117.         width = (chatBoxeslength)*(225+7)+20;
  118.         $("#chatbox_"+chatboxtitle).css('right', width+'px');
  119.     }
  120.    
  121.     chatBoxes.push(chatboxtitle);
  122.  
  123.     if (minimizeChatBox == 1) {
  124.         minimizedChatBoxes = new Array();
  125.  
  126.         if ($.cookie('chatbox_minimized')) {
  127.             minimizedChatBoxes = $.cookie('chatbox_minimized').split(/\|/);
  128.         }
  129.         minimize = 0;
  130.         for (j=0;j<minimizedChatBoxes.length;j++) {
  131.             if (minimizedChatBoxes[j] == chatboxtitle) {
  132.                 minimize = 1;
  133.             }
  134.         }
  135.  
  136.         if (minimize == 1) {
  137.             $('#chatbox_'+chatboxtitle+' .chatboxcontent').css('display','none');
  138.             $('#chatbox_'+chatboxtitle+' .chatboxinput').css('display','none');
  139.         }
  140.     }
  141.  
  142.     chatboxFocus[chatboxtitle] = false;
  143.  
  144.     $("#chatbox_"+chatboxtitle+" .chatboxtextarea").blur(function(){
  145.         chatboxFocus[chatboxtitle] = false;
  146.         $("#chatbox_"+chatboxtitle+" .chatboxtextarea").removeClass('chatboxtextareaselected');
  147.     }).focus(function(){
  148.         chatboxFocus[chatboxtitle] = true;
  149.         newMessages[chatboxtitle] = false;
  150.         $('#chatbox_'+chatboxtitle+' .chatboxhead').removeClass('chatboxblink');
  151.         $("#chatbox_"+chatboxtitle+" .chatboxtextarea").addClass('chatboxtextareaselected');
  152.     });
  153.  
  154.     $("#chatbox_"+chatboxtitle).click(function() {
  155.         if ($('#chatbox_'+chatboxtitle+' .chatboxcontent').css('display') != 'none') {
  156.             $("#chatbox_"+chatboxtitle+" .chatboxtextarea").focus();
  157.         }
  158.     });
  159.  
  160.     $("#chatbox_"+chatboxtitle).show();
  161. }
  162.  
  163.  
  164. function chatHeartbeat(){
  165.  
  166.     var itemsfound = 0;
  167.    
  168.     if (windowFocus == false) {
  169.  
  170.         var blinkNumber = 0;
  171.         var titleChanged = 0;
  172.         for (x in newMessagesWin) {
  173.             if (newMessagesWin[x] == true) {
  174.                 ++blinkNumber;
  175.                 if (blinkNumber >= blinkOrder) {
  176.                     document.title = x+' dice...';/* AKI ES LO DE ARRIBA DEL TITULO*/
  177.                     titleChanged = 1;
  178.                     break; 
  179.                 }
  180.             }
  181.         }
  182.        
  183.         if (titleChanged == 0) {
  184.             document.title = originalTitle;
  185.             blinkOrder = 0;
  186.         } else {
  187.             ++blinkOrder;
  188.         }
  189.  
  190.     } else {
  191.         for (x in newMessagesWin) {
  192.             newMessagesWin[x] = false;
  193.         }
  194.     }
  195.  
  196.     for (x in newMessages) {
  197.         if (newMessages[x] == true) {
  198.             if (chatboxFocus[x] == false) {
  199.                 //FIXME: add toggle all or none policy, otherwise it looks funny
  200.                 $('#chatbox_'+x+' .chatboxhead').toggleClass('chatboxblink');
  201.             }
  202.         }
  203.     }
  204.    
  205.     $.ajax({
  206.       url: "chat.php?action=chatheartbeat",
  207.       cache: false,
  208.       dataType: "json",
  209.       success: function(data) {
  210.  
  211.         $.each(data.items, function(i,item){
  212.             if (item)   { // fix strange ie bug
  213.  
  214.                 chatboxtitle = item.f;
  215.  
  216.                 if ($("#chatbox_"+chatboxtitle).length <= 0) {
  217.                     createChatBox(chatboxtitle);
  218.                 }
  219.                 if ($("#chatbox_"+chatboxtitle).css('display') == 'none') {
  220.                     $("#chatbox_"+chatboxtitle).css('display','block');
  221.                     restructureChatBoxes();
  222.                 }
  223.                
  224.                 if (item.s == 1) {
  225.                     item.f = username;
  226.                 }
  227.  
  228.                 if (item.s == 2) {
  229.                     $("#chatbox_"+chatboxtitle+" .chatboxcontent").append('<div class="chatboxmessage"><span class="chatboxinfo">'+item.m+'</span></div>');
  230.                 } else {
  231.                     newMessages[chatboxtitle] = true;
  232.                     newMessagesWin[chatboxtitle] = true;
  233.                     $("#chatbox_"+chatboxtitle+" .chatboxcontent").append('<div class="chatboxmessage"><span class="chatboxmessagefrom">'+item.f+':&nbsp;&nbsp;</span><span class="chatboxmessagecontent">'+item.m+'</span></div>');
  234.                 }
  235.  
  236.                 $("#chatbox_"+chatboxtitle+" .chatboxcontent").scrollTop($("#chatbox_"+chatboxtitle+" .chatboxcontent")[0].scrollHeight);
  237.                 itemsfound += 1;
  238.             }
  239.         });
  240.  
  241.         chatHeartbeatCount++;
  242.  
  243.         if (itemsfound > 0) {
  244.             chatHeartbeatTime = minChatHeartbeat;
  245.             chatHeartbeatCount = 1;
  246.         } else if (chatHeartbeatCount >= 10) {
  247.             chatHeartbeatTime *= 2;
  248.             chatHeartbeatCount = 1;
  249.             if (chatHeartbeatTime > maxChatHeartbeat) {
  250.                 chatHeartbeatTime = maxChatHeartbeat;
  251.             }
  252.         }
  253.        
  254.         setTimeout('chatHeartbeat();',chatHeartbeatTime);
  255.     }});
  256. }
  257.  
  258. function closeChatBox(chatboxtitle) {
  259.     $('#chatbox_'+chatboxtitle).css('display','none');
  260.     restructureChatBoxes();
  261.  
  262.     $.post("chat.php?action=closechat", { chatbox: chatboxtitle} , function(data){ 
  263.     });
  264.  
  265. }
  266.  
  267. function toggleChatBoxGrowth(chatboxtitle) {
  268.     if ($('#chatbox_'+chatboxtitle+' .chatboxcontent').css('display') == 'none') {  
  269.        
  270.         var minimizedChatBoxes = new Array();
  271.        
  272.         if ($.cookie('chatbox_minimized')) {
  273.             minimizedChatBoxes = $.cookie('chatbox_minimized').split(/\|/);
  274.         }
  275.  
  276.         var newCookie = '';
  277.  
  278.         for (i=0;i<minimizedChatBoxes.length;i++) {
  279.             if (minimizedChatBoxes[i] != chatboxtitle) {
  280.                 newCookie += chatboxtitle+'|';
  281.             }
  282.         }
  283.  
  284.         newCookie = newCookie.slice(0, -1)
  285.  
  286.  
  287.         $.cookie('chatbox_minimized', newCookie);
  288.         $('#chatbox_'+chatboxtitle+' .chatboxcontent').css('display','block');
  289.         $('#chatbox_'+chatboxtitle+' .chatboxinput').css('display','block');
  290.         $("#chatbox_"+chatboxtitle+" .chatboxcontent").scrollTop($("#chatbox_"+chatboxtitle+" .chatboxcontent")[0].scrollHeight);
  291.     } else {
  292.        
  293.         var newCookie = chatboxtitle;
  294.  
  295.         if ($.cookie('chatbox_minimized')) {
  296.             newCookie += '|'+$.cookie('chatbox_minimized');
  297.         }
  298.  
  299.  
  300.         $.cookie('chatbox_minimized',newCookie);
  301.         $('#chatbox_'+chatboxtitle+' .chatboxcontent').css('display','none');
  302.         $('#chatbox_'+chatboxtitle+' .chatboxinput').css('display','none');
  303.     }
  304.    
  305. }
esta es la primera parte.

Última edición por edie8; 26/08/2012 a las 04:33
  #5 (permalink)  
Antiguo 26/08/2012, 04:34
 
Fecha de Ingreso: noviembre-2011
Mensajes: 516
Antigüedad: 12 años, 5 meses
Puntos: 10
Respuesta: problemas con un chat

Código Javascript:
Ver original
  1. function checkChatBoxInputKey(event,chatboxtextarea,chatboxtitle,chatid) {
  2.      
  3.     if(event.keyCode == 13 && event.shiftKey == 0)  {
  4.         message = $(chatboxtextarea).val();
  5.         message = message.replace(/^\s+|\s+$/g,"");
  6.  
  7.         $(chatboxtextarea).val('');
  8.         $(chatboxtextarea).focus();
  9.         $(chatboxtextarea).css('height','44px');
  10.         if (message != '') {
  11.             $.post("chat.php?action=sendchat", {to: chatid, message: message} , function(data){
  12.                 message = message.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;");
  13.                 $("#chatbox_"+chatboxtitle+" .chatboxcontent").append('<div class="chatboxmessage"><span class="chatboxmessagefrom">'+username+':&nbsp;&nbsp;</span><span class="chatboxmessagecontent">'+message+'</span></div>');
  14.                 $("#chatbox_"+chatboxtitle+" .chatboxcontent").scrollTop($("#chatbox_"+chatboxtitle+" .chatboxcontent")[0].scrollHeight);
  15.             });
  16.         }
  17.         chatHeartbeatTime = minChatHeartbeat;
  18.         chatHeartbeatCount = 1;
  19.  
  20.         return false;
  21.     }
  22.  
  23.     var adjustedHeight = chatboxtextarea.clientHeight;
  24.     var maxHeight = 94;
  25.  
  26.     if (maxHeight > adjustedHeight) {
  27.         adjustedHeight = Math.max(chatboxtextarea.scrollHeight, adjustedHeight);
  28.         if (maxHeight)
  29.             adjustedHeight = Math.min(maxHeight, adjustedHeight);
  30.         if (adjustedHeight > chatboxtextarea.clientHeight)
  31.             $(chatboxtextarea).css('height',adjustedHeight+8 +'px');
  32.     } else {
  33.         $(chatboxtextarea).css('overflow','auto');
  34.     }
  35.      
  36. }
  37.  
  38. function startChatSession(){  
  39.     $.ajax({
  40.       url: "chat.php?action=startchatsession",
  41.       cache: false,
  42.       dataType: "json",
  43.       success: function(data) {
  44.  
  45.         username = data.username;
  46.  
  47.         $.each(data.items, function(i,item){
  48.             if (item)   { // fix strange ie bug
  49.  
  50.                 chatboxtitle = item.f;
  51.  
  52.                 if ($("#chatbox_"+chatboxtitle).length <= 0) {
  53.                     createChatBox(chatid,1);
  54.                 }
  55.                
  56.                 if (item.s == 1) {
  57.                     item.f = username;
  58.                 }
  59.  
  60.                 if (item.s == 2) {
  61.                     $("#chatbox_"+chatboxtitle+" .chatboxcontent").append('<div class="chatboxmessage"><span class="chatboxinfo">'+item.m+'</span></div>');
  62.                 } else {
  63.                     $("#chatbox_"+chatboxtitle+" .chatboxcontent").append('<div class="chatboxmessage"><span class="chatboxmessagefrom">'+item.f+':&nbsp;&nbsp;</span><span class="chatboxmessagecontent">'+item.m+'</span></div>');
  64.                 }
  65.             }
  66.         });
  67.        
  68.         for (i=0;i<chatBoxes.length;i++) {
  69.             chatboxtitle = chatBoxes[i];
  70.             $("#chatbox_"+chatboxtitle+" .chatboxcontent").scrollTop($("#chatbox_"+chatboxtitle+" .chatboxcontent")[0].scrollHeight);
  71.             setTimeout('$("#chatbox_"+chatboxtitle+" .chatboxcontent").scrollTop($("#chatbox_"+chatboxtitle+" .chatboxcontent")[0].scrollHeight);', 100); // yet another strange ie bug
  72.         }
  73.    
  74.     setTimeout('chatHeartbeat();',chatHeartbeatTime);
  75.        
  76.     }});
  77. }
  78.  
  79.  
  80. jQuery.cookie = function(name, value, options) {
  81.     if (typeof value != 'undefined') { // name and value given, set cookie
  82.         options = options || {};
  83.         if (value === null) {
  84.             value = '';
  85.             options.expires = -1;
  86.         }
  87.         var expires = '';
  88.         if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
  89.             var date;
  90.             if (typeof options.expires == 'number') {
  91.                 date = new Date();
  92.                 date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
  93.             } else {
  94.                 date = options.expires;
  95.             }
  96.             expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
  97.         }
  98.         var path = options.path ? '; path=' + (options.path) : '';
  99.         var domain = options.domain ? '; domain=' + (options.domain) : '';
  100.         var secure = options.secure ? '; secure' : '';
  101.         document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
  102.     } else { // only name given, get cookie
  103.         var cookieValue = null;
  104.         if (document.cookie && document.cookie != '') {
  105.             var cookies = document.cookie.split(';');
  106.             for (var i = 0; i < cookies.length; i++) {
  107.                 var cookie = jQuery.trim(cookies[i]);
  108.                 // Does this cookie string begin with the name we want?
  109.                 if (cookie.substring(0, name.length + 1) == (name + '=')) {
  110.                     cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
  111.                     break;
  112.                 }
  113.             }
  114.         }
  115.         return cookieValue;
  116.     }
  117. };
y esta es la continuacion, alguien sabe a que es debido esto??? les agradeceria mucho la ayuda.
  #6 (permalink)  
Antiguo 17/09/2012, 07:03
 
Fecha de Ingreso: noviembre-2011
Mensajes: 516
Antigüedad: 12 años, 5 meses
Puntos: 10
Respuesta: problemas con un chat

Con el firebug de crhome e descubierto que el fallo esta aqui:
<textarea class="chatboxtextarea" onkeydown="javascript:return checkChatBoxInputKey(event,this,'2');"/>
y aqui es donde no me funciona al recibir el mensaje el otro usuario:
<textarea class="chatboxtextarea" onkeydown="javascript:return checkChatBoxInputKey(event,this,'edyuin','undefine d');"/>

Que se corresponde con este trozo de codigo:
Código Javascript:
Ver original
  1. function createChatBox(chatboxtitle,chatid,email,minimizeChatBox) {
  2.     if ($("#chatbox_"+chatboxtitle).length > 0) {
  3.         if ($("#chatbox_"+chatboxtitle).css('display') == 'none') {
  4.             $("#chatbox_"+chatboxtitle).css('display','block');
  5.             restructureChatBoxes();
  6.         }
  7.         $("#chatbox_"+chatboxtitle+" .chatboxtextarea").focus();
  8.         return;
  9.     }
  10.  
  11.     $(" <div />" ).attr("id","chatbox_"+chatboxtitle)
  12.     .addClass("chatbox")
  13.     .html('<div class="chatboxhead"><div class="chatboxtitle">'+chatboxtitle+','+chatid+'</div><div class="chatboxoptions"><a href="javascript:void(0)" onclick="javascript:toggleChatBoxGrowth(\''+chatboxtitle+'\','+chatid+')">-</a> <a href="javascript:void(0)" onclick="javascript:closeChatBox(\''+chatboxtitle+'\','+chatid+')">X</a></div><br clear="all"/></div><div class="chatboxcontent"></div><div class="chatboxinput"><textarea class="chatboxtextarea" onkeydown="javascript:return checkChatBoxInputKey(event,this,\''+chatboxtitle+'\',\''+chatid+'\');"></textarea></div>')
  14.     .appendTo($( "body" ));
  15.                
  16.     $("#chatbox_"+chatboxtitle).css('bottom', '0px');
  17.    
  18.     chatBoxeslength = 0;
  19.  
  20.     for (x in chatBoxes) {
  21.         if ($("#chatbox_"+chatBoxes[x]).css('display') != 'none') {
  22.             chatBoxeslength++;
  23.         }
  24.     }
  25.  
  26.     if (chatBoxeslength == 0) {
  27.         $("#chatbox_"+chatboxtitle).css('right', '20px');
  28.     } else {
  29.         width = (chatBoxeslength)*(225+7)+20;
  30.         $("#chatbox_"+chatboxtitle).css('right', width+'px');
  31.     }
  32.    
  33.     chatBoxes.push(chatboxtitle);
  34.  
  35.     if (minimizeChatBox == 1) {
  36.         minimizedChatBoxes = new Array();
  37.  
  38.         if ($.cookie('chatbox_minimized')) {
  39.             minimizedChatBoxes = $.cookie('chatbox_minimized').split(/\|/);
  40.         }
  41.         minimize = 0;
  42.         for (j=0;j<minimizedChatBoxes.length;j++) {
  43.             if (minimizedChatBoxes[j] == chatboxtitle) {
  44.                 minimize = 1;
  45.             }
  46.         }
  47.  
  48.         if (minimize == 1) {
  49.             $('#chatbox_'+chatboxtitle+' .chatboxcontent').css('display','none');
  50.             $('#chatbox_'+chatboxtitle+' .chatboxinput').css('display','none');
  51.         }
  52.     }
  53.  
  54.     chatboxFocus[chatboxtitle] = false;
  55.  
  56.     $("#chatbox_"+chatboxtitle+" .chatboxtextarea").blur(function(){
  57.         chatboxFocus[chatboxtitle] = false;
  58.         $("#chatbox_"+chatboxtitle+" .chatboxtextarea").removeClass('chatboxtextareaselected');
  59.     }).focus(function(){
  60.         chatboxFocus[chatboxtitle] = true;
  61.         newMessages[chatboxtitle] = false;
  62.         $('#chatbox_'+chatboxtitle+' .chatboxhead').removeClass('chatboxblink');
  63.         $("#chatbox_"+chatboxtitle+" .chatboxtextarea").addClass('chatboxtextareaselected');
  64.     });
  65.  
  66.     $("#chatbox_"+chatboxtitle).click(function() {
  67.         if ($('#chatbox_'+chatboxtitle+' .chatboxcontent').css('display') != 'none') {
  68.             $("#chatbox_"+chatboxtitle+" .chatboxtextarea").focus();
  69.         }
  70.     });
  71.  
  72.     $("#chatbox_"+chatboxtitle).show();
  73. }
Si alguien es tan amable de echarme una mano porque despues de un mes sigo sin encontrar el fallo de mi codigo, necesito vuestra ayuda, gracias y un saludo. me sale un espacio que al ediitarlo ya no esta es undefined.

Última edición por edie8; 17/09/2012 a las 07:21
  #7 (permalink)  
Antiguo 17/09/2012, 14:24
 
Fecha de Ingreso: noviembre-2011
Mensajes: 516
Antigüedad: 12 años, 5 meses
Puntos: 10
Respuesta: problemas con un chat

Nadie sabe que puede estar fallandome??

Etiquetas: chat, html, js, php, select
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 16:36.