
Untitled
By: a guest on
May 15th, 2012 | syntax:
None | size: 1.18 KB | hits: 26 | expires: Never
Uppercase first letter of a string chrashes in IE7
actualizarTituloWeb('brand name - '+seccion.toLowerCase().replace(/(?:_| |b)(w)/g, function(str, p1) { return p1.toUpperCase()}));
function actualizarTituloWeb(titulo){
$( 'title' ).html ( titulo );
}
function actualizarTituloWeb(titulo){
titulo = titulo[0].toUpperCase() + titulo.substring(1);
titulo = titulo.toLowerCase();
$( 'title' ).text ( titulo );
return false;
}
titulo = titulo[0].toUpperCase() + titulo.substring(1);
titulo = titulo.charAt(0).toUpperCase() + titulo.substring(1);
<html>
<head>
<title>test</title>
</head>
<body>
<script type='text/javascript'>
document.getElementsByTagName('title')[ 0 ].firstChild // null in IE <= 8
// IE 9 (and other browser): text node with nodeValue 'test'
</script>
</body>
</html>
document.title = titulo;
actualizarTituloWeb('brand name - ' + seccion.toLowerCase().replace(/(^|s|-)(.)/gi, function(c) { return c.toUpperCase()}));
var str = "blah blah";
str = str.toLowerCase();
str = str[0].toUpperCase() + str.substring(1);
document.title = str;