actualizarTituloWeb('brand name - '+seccion.toLowerCase().replace(/(?:_| |\b)(\w)/g, function(str, p1) { return p1.toUpperCase()}));
Where
function actualizarTituloWeb(titulo){ $( 'title' ).html ( titulo ); }
Also tried with:
function actualizarTituloWeb(titulo){ titulo = titulo[0].toUpperCase() + titulo.substring(1); titulo = titulo.toLowerCase(); $( 'title' ).text ( titulo ); return false; }
and seccion has values โโlike 'Reserva', 'ofertas', ..
Iโm not sure why it doesnโt work, but this actually leads to the failure of the whole script (you can test it in live here: http://toniweb.us/gm2 ) in IE7, and the title of the current document is not updated.
any idea what i'm missing?
-Edit -
I just realized that the problem is in this line! why?
titulo = titulo[0].toUpperCase() + titulo.substring(1);
Note: We cannot use CSS to achieve this, because it will be used for document.title
source share