Some friends asked me how to add music to their blogs. Here is a simple enough way that you can start with:
1. Login to blogger and select your blog
2. Select Template tab
3. Include the following text in the template, say, before Heading starts but note that the templates vary depending on the style you picked
4. Save and Republish the whole blog
Here is a sample of the script (click to enlarge):
The text file can be found here (don't click, use right click and save target as).
You can change the music file to your own choice by changing the URL.
This is a simple start you can try. Now the pitfalls are:
> It only plays 1 music file.
> Whenever you change the music file, you need to go to Template, Edit, Save and Republish.
What I did in my blog:
> Use an external .js file (a text file) and so I can alter the .js file without the need to change the blog's template & re-publish.
> Include a list of music files I want and select randomly.
> The .js file and private collection of music files are hosted using geocities.
There is no secret about my code as you can find here (again, right click and save target as) but I won't discuss further in this article unless my beginner friends want to know more. The script also contains the code for the clock pointer.
P.S. If you use external script file, there shouldn't be any HTML tags inside.
Disclamer: I didn't know how to write javascript. I just picked up the minimum by referencing how others did it. Therefore, I am more than happy if you share with me what additional stuffs we can do without much effort.
No comments:
Post a Comment