Fighting MALICIOUS_JAVASCRIPT Notice in Blogger

There have been many cases where a user's blog got deleted because of Malicious Javascript. It's frustrating to get your blog deleted but it's just down for a review. Read why it happens and how to prevent it.
Blogger is one of the most popular CMS and the as it's free, spammers love to target their victims using Blogger blogs. Spreading malicious software and viruses has become easy for spammers and thus blogger blogs are becoming a weapon for those evil spam spreaders. The Blogger platform was already secure as it doesn't allow the user to access server side configurations but yet the spammers can use JavaScript to trick their victim and infect their system with malware etc.

Keeping all these things in mind, blogger created a better spam detection system checks blogs for JavaScripts which redirects or does any other weird tasks and take down the site for safety of the readers.

I am not a spammer! Why my blog got deleted?

The spam detection system scans the blog for any suspicious scripts which can be a possible threat and then takes it down as I already said. It doesn't have anything to do with your profile.

Usually spammers add JavaScript that does a redirect to a site or link to a virus, which infects your system and can do anything the virus creator wants it to do. But recently many normal blogger users' blog were taken down for MALICIOUS_JAVASCRIPT as many users use scripts and codes from external site without knowing what exactly it does. For example, when blogger introduced country specific redirection and a blog posted a script that stopped country specific redirection (which actually redirects the blog URL adding /ncr at the end). Here's the snippet of code used :
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 += "" + slug;

The blog that published this article is quite popular and many blogger users used this code to stop country specific redirection. This is an example of scripts which can get blog deleted.

How do I restore my Blog?

Blogger spam detection and review system has got better. It now provides option for users to submit their blog for spam review.

If you see a notice for your blog that indicates that your blog has been removed, you can now take action to restore it. Blogs deleted by spam detection system now will appear in the Deleted Blogs section in the Dashboard.

Log into your Blogger Dashboard -> and click on Deleted blogs on the left hand side

All your deleted blogs will be on that page, and the blogs deleted for spam and malicious javascript there will be a Restore button next to the blog name. It will send the blog for review to Google/Blogger Spam experts. You will get the reply within 48 hours.

Now beware of of JavaScript codes on the internet, not all of them are spam but before adding them check what people are discussing about it, is it okay to use or has any problem.