|
function setTitle(name){ // Will change the title of the page // Name Type Use // @ Param name String New page title document.title = document.title.replace(/\s-\s.+?(?!\s-\s)$/i," - "+name); } Really short, and a little advanced RegExp.
|
|
|
|
|
So this code will replace the title name on the browser?
|
Ex-admin, designer and founder of Studio Zero. Currently working as a Dentist
|
|
|
|
Yes it will.
|
Further Solutions :: Hosting :: Scripts :: Templates furthersolutions.com
v4 Studios - Coming soon
|
|
|
|
Yeah, that's what it does Joe
|
|
|
|
|
function title(ntitle) { document.title = document.title.split(/-/)[0] + '- '+ntitle; }
|
|
|
|
Now lets assume some forum makes their title fancy. " - Cool Designs - Home" Do you see a problem? Cause I do.
|
|
|
|