Ver Mensaje Individual
  #2 (permalink)  
Antiguo 18/05/2010, 21:07
Avatar de Yedi
Yedi
 
Fecha de Ingreso: junio-2006
Ubicación: México
Mensajes: 159
Antigüedad: 17 años, 10 meses
Puntos: 2
Respuesta: Codificacion de acentos dentro de funciones en java

Hola de nuevo

Voya reeplanear mi problema con los pocos avances que tengo

En el siguiente codigo tengo mi archivo de php y hago una llamada utilizando javascript la cual en la misma ventana pero del lado derecho de mi pagina me muestra mi texto sacado de una bd. La pagina se compone de un calendario el cual manda a llamar varios archivos para completar el calendario

Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type" />
<
title>Documento sin t&iacute;tulo</title>
</
head>
 
<
body>
</
body>
</
html>
<
script type='text/javascript'
/*** local Javascript float routines ***************************************/
 
var IE document.all?true:false;
if (!
IEdocument.captureEvents(Event.MOUSEMOVE)
document.onmousemove qCalendarGetMouseXY;
var 
qCalendarMouseX 0;
var 
qCalendarMouseY 0;
 
function 
qCalendarGetMouseXY(e) {
    if (
IE) {
        
qCalendarMouseX event.clientX document.body.scrollLeft;
        
qCalendarMouseY event.clientY document.body.scrollTop;
    }
    else {
        
qCalendarMouseX e.pageX;
        
qCalendarMouseY e.pageY;
    }
    return 
true;
}
 
function 
qCalendarDetailsFloatOn(divLongDescthemeid) {
    
// move the div box
    
document.getElementById(divLongDesc).style.left=qCalendarMouseX 'px';
    
document.getElementById(divLongDesc).style.top=qCalendarMouseY 'px';
    
// display content
    
document.getElementById(divLongDesc).style.visibility='visible';
    
qCalendarDetails(divLongDescthemeid);
}
 
function 
qCalendarAllDetailsFloatOn(divLongDescthemedmyc) {
    
// move the div box
    
document.getElementById(divLongDesc).style.left=qCalendarMouseX 'px';
    
document.getElementById(divLongDesc).style.top=qCalendarMouseY 'px';
    
// display content
    
document.getElementById(divLongDesc).style.visibility='visible';
    
qCalendarAllDetails(divLongDescthemedmyc);
}
 
function 
qCalendarDetailsFloatOff(divLongDesc) {
    
// hid float
    
document.getElementById(divLongDesc).style.visibility='hidden';
}
 
/*** AJAX client-side Javascript ********************************************/
 
function createQCObject() {
   var 
req;
   if(
window.XMLHttpRequest){
      
// Firefox, Safari, Opera...
      
req = new XMLHttpRequest();
   } else if(
window.ActiveXObject) {
      
// Internet Explorer 5+
      
req = new ActiveXObject('Microsoft.XMLHTTP');
   } else {
      
alert('Problem creating the XMLHttpRequest object');
   }
   return 
req;
}
 
// Make the XMLHttpRequest object
var xhr createQCObject();
 
//  qcalendarsyspath is set in controller.php
 
function displayQCalendar(themedivCalendardivLongDescdmyc) {
    var 
ran_no = new Date().getTime();
    
xhr.open('get'qcalendarsyspath+'controller.php?theme='+theme+'&divCalendar='+divCalendar+'&divLongDesc='+divLongDesc+'&d='+d+'&m='+m+'&y='+y+'&c='+c+'&ran='+ran_no);
    
xhr.onreadystatechange = function() {
        if (
xhr.readyState == && xhr.status == 200) {
            var 
response xhr.responseText;
            if(
response) {
                
document.getElementById(divCalendar).innerHTML response;
            }
        }
    }
    
xhr.send(null);
}
 
function 
qCalendarDetails(divLongDescthemeid) {
    var 
ran_no = new Date().getTime();
    
xhr.open('get'qcalendarsyspath+'controller.php?theme='+theme+'&id='+id+'&ran='+ran_no);
    
xhr.onreadystatechange = function() {
        if (
xhr.readyState == && xhr.status == 200) {
            var 
response xhr.responseText;
            if(
response) {
                
document.getElementById(divLongDesc).innerHTML response;
            }
 
        }
    }
    
xhr.send(null);
}
 
function 
qCalendarAllDetails(divLongDescthemedmyc) {
    
    var 
ran_no = new Date().getTime();
    
xhr.open('get'qcalendarsyspath+'controller.php?theme='+theme+'&d='+d+'&m='+m+'&y='+y+'&c='+c+'&ran='+ran_no);
    
xhr.onreadystatechange = function() {
        if (
xhr.readyState == && xhr.status == 200) {
            var 
response xhr.responseText;
            if(
response) {
                
document.getElementById(divLongDesc).innerHTML response;
            }
        }
    }
    
xhr.send(null);

 
 
 
/* <![CDATA[ */
qcalendarsyspath '/job/qcalendar'+'/';
/* ]]> */
</script>
</body>
</html>
 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type" />
<head>
<title>Eventos</title>
<script src="../Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<link href="../css/estilos.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width='1200' border='0' align='left' >
  <tr>
    <td><div align='center'></div></td>
  </tr>
  <tr>
    <td height='260' colspan='2' valign='top'>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type" />
<title>CALENDAR</title>
</head>
 
<body>
</body>
</html>
<script type='text/javascript' ></script><link href="/ipuntorp-www/qcalendar/themes/standard/view/calendar.css" rel="stylesheet" type="text/css" /><div style="margin: 0;padding: 0;border: 0;outline: 0;font-size: 100%;vertical-align: baseline;background: transparent; text-align:center;"><div id='qCalendarStandard' style='float:left;margin-left:40px;'><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type" />
<title>Documento sin t&iacute;tulo</title>
</head>
 
<body>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type" />
<title>Documento sin t&iacute;tulo</title>
</head>
 
<body>
<table class='standard' >
<thead>
<tr><th>&nbsp;<a href="#" onclick="displayQCalendar('standard', 'qCalendarStandard', 'myContentStandard', '18', '5','2009', '0')"title='Prev Year'><<</a></th>
<th>&nbsp;<a href="#" onclick="displayQCalendar('standard', 'qCalendarStandard', 'myContentStandard', '18', '4','2010', '0')" title='Prev Month'><</a></th>
<th colspan='3'>May 2010</th>
<th><a href="#" onclick="displayQCalendar('standard', 'qCalendarStandard', 'myContentStandard', '18', '6','2010', '0')" class='headerNav' title='Next Month'>></a>&nbsp;</th>
<th>&nbsp;<a href="#" onclick="displayQCalendar('standard', 'qCalendarStandard', 'myContentStandard', '18', '5','2011', '0')" class='headerNav' title='Next Year'>>></a></th>
</tr>
</thead>
 
<tbody>
<tr><th>Dom</th><th>Lun</th><th>Mar</th><th>Mier</th><th>Jue</th><th>Vie</th><th>Sab</th></tr>
<tr><td width='184'><br/></div></td><td width='184'><br/></div></td><td width='184'><br/></div></td><td width='184'><br/></div></td><td width='184'><br/></div></td><td width='184'><br/></div></td><td width='184'>1<br/></div></td></tr><tr><td width='184'>2<br/></div></td><td width='184'>3<br/></div></td><td width='184'>4<br/></div></td><td width='184'>5<br/></div></td><td width='184'>6<br/></div></td><td width='184'>7<br/><div class='cellLink'><li><a href="javascript:;" onclick="qCalendarDetails('myContentStandard', 'standard', 1)" >my birthday &a ñ á ñ</a></li></div></td><td width='184'>8<br/></div></td></tr><tr><td width='184'>9<br/><div class='cellLink'><li><a href="javascript:;" onclick="qCalendarDetails('myContentStandard', 'standard', 15)" >Do homework ácentós con la letra ñ</a></li></div></td><td width='184'>10<br/></div></td><td width='184'>11<br/></div></td><td width='184'>12<br/></div></td><td width='184'>13<br/></div></td><td width='184'>14<br/></div></td><td width='184'>15<br/><li>full moon every month reminder.</li></div></td></tr><tr><td width='184'>16<br/></div></td><td width='184'>17<br/></div></td><td width='184'>18<br/><div class='cellLink'><a href="javascript:;" onclick="qCalendarDetails('myContentStandard', 'standard', 29)" ><img src="/ipuntorp-www/qcalendar/images/1.jpeg"></a><li><a href="javascript:;" onclick="qCalendarDetails('myContentStandard', 'standard', 29)" >mm</a></li></div></td><td width='184'>19<br/></div></td><td width='184'>20<br/></div></td><td width='184'>21<br/></div></td><td width='184'>22<br/></div></td></tr><tr><td width='184'>23<br/></div></td><td width='184'>24<br/></div></td><td width='184'>25<br/></div></td><td width='184'>26<br/></div></td><td width='184'>27<br/></div></td><td width='184'>28<br/></div></td><td width='184'>29<br/></div></td></tr><tr><td width='184'>30<br/></div></td><td width='184'>31<br/></div></td><td width='184'><br/></div></td><td width='184'><br/></div></td><td width='184'><br/></div></td><td width='184'><br/></div></td><td width='184'><br/></div></td></tr></tbody>
 
<tfoot>
<tr><th colspan='7'><a href="#" onclick="displayQCalendar('standard', 'qCalendarStandard', 'myContentStandard', '18', '5','2010', '0')">
Hoy es 18 May 2010</a></th></tr>
</tfoot>
 
</table>
</body>
</html>
</div></div><link href="/ipuntorp-www/qcalendar/themes/standard/view/longdesc.css" rel="stylesheet" type="text/css" /><div id='myContentStandard' style='float:right;padding-left:20px;width:300px'></div><div style='clear:both'></div></td> </tr> </table></body>
</html> 
Mi problema es que la parte del calendario los acentos los muestra bien, pero la parte que llama a javascript lo muestra sin acentos...¿Como puedo mostrar mis acentos sin cuadritos o caracteres extraños?

Mil gracias y cualquier idea, consejo o sugerencia es bienvenido