Showing posts with label blogger. Show all posts
Showing posts with label blogger. Show all posts

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

Sunday, January 27, 2008

[Javascript, DHTML] Easiest way to add del.icio.us post from Blogger

problem: There's no way in hell you can find any ready-to-use pluggable html snippet to add the current page of your blogger blog (current version) to the user's del.icio.us links.

solution: copy-paste the following wherever you want:

<a href='' id='delicious'>
<img alt='Add the butchers to your Del.icio.us!'
height='15'
src='http://images.del.icio.us/static/img/delicious.42px.gif'/>

</a>
<script language='javascript'
type='text/javascript'>

var currentURL = window.location;
document.getElementById('delicious').href =
"http://del.icio.us/post?url=" + currentURL;

</script>


I am lazy, so I was looking for something to copy-paste into the html and amen. After an hour or so of roaming without finding anything usable as-it-is, I decided my laziness was costing me more than actually making the thing myself (what the heck). So I did it. This technique obviously will work with any of the linksharing networks (digg and others) or whatever, but the difference is I could find ready-to-plug snippet for the others. Maybe it'll save some precious hours of laziness to some other copy-paste butcher.