Translate

How to add HTML or JavaScript code

Leave a Comment
Have you ever looked at your Blogger template and thought it looks a bit…Boring? But then you go to change your template and none of the available options seem to have the features you want. You scroll through Blogger’s list of extra features and widgets and still just can’t find what you need. You may find yourself wondering, “How do I make my blog stand out from the crowd and properly engaged the user?”

Blogs are designed to be “clean” and provide a distraction-free reading service, but sometimes the specific purpose or mission of your blog demands something a bit more dynamic and interactive. However, building an entire website of your own from scratch to accomplish what you want would be impractical, or maybe impossible for you due to the amount of HTML, Javascript, and other coding languages involved.

Luckily there is a kind of middle ground. Blogger allows you to create and add bits of HTML and Javascript to your Blogger blog, so that you can insert the kind of functions you want by creating custom widgets. These widgets, also known as gadgets on Blogger, are small tools or applications that can be added to a website or blog in order to create whatever function you need, in essence, or to bring in content and services from third-party websites. The diversity of these widgets (or gadgets) is almost as unlimited at your imagination. You can create countdown tickers, photos, games, or interactive applications that allow you to connect to your social media platforms and even chat right from your blog—making it a lot easier to keep up with your readers! Blogger widgets can also help you track your popularity, such as by listing your blog followers, and they can help you reach more people, for example by allowing readers to subscribe to your blog content. The following tutorial will step you through adding HTML and/or Javascript to your Blogger blog so that you can make it as dynamic and interesting as your written content:

Add HTML or JavaScript code to your Blogger blogs

Sign into your account. You will be taken to the Dashboard. Click on "Layout" of your blog - see image below:

click layout on blogspot

You'll be taken to the "Layout" page. Find an empty slots with "Add a Gadget" link on them. Choose where you want to put your code and click "Add a Gadget". This will open a small window with list of gadgets, find "HTML/JavaScript" gadget and click "+" to add it - see image below:

blogspot javascript

You're almost done. Now copy the code you want to add and paste it on "Content" box. You can also name the code in "Title" box (or leave it blank). Click "Save" and visit your blog. Your HTML/JavaScript code must be on place.
Read More

Disable 302 Redirection to Country Specific Domains

Leave a Comment
As many of you may know, Google is continuously releasing updates in order to improve its services, particularly in the area of generating better search results. In Jan 31, 2012 Google started to implement Country-Specific url redirects to Blogger.

What is that mean?

In simple terms, if you are viewing a blog with an address such as example.blogspot.com from France (FR), then you'll be redirected to a .fr domain: example.blogspot.fr. Similarly, if you are viewing from United Kingdom it will be redirected to example.blogspot.co.uk.

This might sound like no big deal—who cares what a blog URL ends with, right? Wrong. Google’s motives are something any serious blogger should care about in this case; this is happening so that Google can easily block any content which is not appropriate for a specify country according to the law of that country, and can easily serve that same content in another country without any issues. This is an act of “selective censorship” being perpetrated against writers without their consent. If you have ever tried to watch a video that is freely available in, for example, the United States, from just about anywhere else, you know the frustration this kind of behaviour can cause—the video is often blocked to you for no real reason beyond outdated international copyright laws, laws drafted long before the internet existed that have simply refused to adapt in a timely manner.

More seriously, many countries with tyrannical governments employ censorship to help control the populace and restrict their access to information that could seriously aid them in their fight against oppression. Who wants to allow their blog to be censored in a nation simply because its government has arbitrarily decided to isolate and brainwash its populace? The beauty of the internet is that it is based on the freedom of unbiased information, and this is a mission that we, as writers, are bound by duty to uphold.

This country based URL redirection also has negative consequences for your blog itself.
This forced redirection causes your Alexa Traffic Rank will to be separated to different domains. This redirection is  a "302 Redirect" which is a temporary change, and not a 301 redirect, which is a permanent change of address. So, even if you are not bothered about content restriction issues, for better search engine optimization (SEO), you need to fix this issue or risk a loss of exposure.

Thankfully, there is a way to do so; you do not have to let your blog fall victim to censorship and the enforcement of antiquated laws. To fix this problem, you must also employ the following piece of code, adding it to your template; it will ensure that your blog always serves the .com address to your visitors.

Disable Blogger Redirection to Country Specific Domains:

Go to Design -> Edit HTML and search for "</head>".
Now copy and paste the following code BEFORE the </head> tag.
<script type="text/javascript">
var blog = document.location.hostname;
var slug = document.location.pathname;
var ctld = blog.substr(blog.lastIndexOf("."));
if (ctld != ".com") {
var ncr = "http://" + blog.substr(0, blog.indexOf("."));
ncr += ".blogspot.com/ncr" + slug;
window.location.replace(ncr);
}
</script>
Save your template and you are ready :)
Read More
Next PostNewer Posts Previous PostOlder Posts Home

Popular Last 7 days

Powered by Blogger.

Subscribe