
13/12/2010, 03:52
|
| | Fecha de Ingreso: junio-2003
Mensajes: 318
Antigüedad: 21 años, 8 meses Puntos: 0 | |
Problema IE al recoger string Hola a todos.
Tengo un texto inicial y quiero dividirlo en dos. Para ello recorro mediante un "for" el texto inicial y separo el texto en dos variables diferentes antes del caracter numero 200 y despues del caracter numero 200:
function textForSection(textSection) {
var numCharacters = textSection.length;
var newTextVisible = "";
var newTextNoVisible = "";
for (i = 0; i <= (numCharacters - 1); i++) {
if (i <= 220) {newTextVisible = newTextVisible + "" + textSection[i] + "";}
else {newTextNoVisible = newTextNoVisible + "" + textSection[i] + "";}
}
$('#textSection span.textSectionVisible').text(newTextVisible);
$('#textSection div.textSectionNoVisible').text(newTextNoVisible);
}
El problema es que esto me funciona perfectamente en todos los navegadores menos en Internet Explorer donde la variable textSection[i] es "undefined" en cada posicion.
Alguna idea de que estoy haciendo mal????
Gracias a todos. |