Saturday, October 25, 2008

[Blogger] How to dinamically change Blog Title

You can dinamically change your Blogger Blog title to whatever you want (in this case you're changin it into 'NEW KICK-ASS TITLE') using the following Javascript snippet:


var myKickAssScript = "document.getElementById('header-inner').getElementsByTagName('h1')[0].innerHTML = 'NEW KICK-ASS TITLE'";
setTimeout(myKickAssScript, 2000);



We have to set a timeout in order to wait for the title element to be injected by the blogger engine. You can put this js code in the script element that's in the head section of the markup (you can edit it from 'edit HTML' section on your blog settings). 
If you put the snippet (passed as string to the timeOut function above) at the bottom of the page (or as event handler for the onLoad event) you obviously don't need to set up a timer.


It'll work as long as they decide to keep the page markup as it is now.

P.S. check-out my NEW KICK-ASS TITLE

2 comments:

Anonymous said...
This comment has been removed by a blog administrator.
John Rockefeller said...

Yes i lke ths blog alot to.