How to remove Google Translate Top Frame

Posted: December 30, 2011 in Uncategorized

I cannot find any guide regarding the title and luckily I stumble upon a website the uses Google translate and I noticed every time I click on to another language it redirects to translate.google.com and removes the top frame. I am a programmer (but a dumb one) and with that little background I became curious and analyze the source code of the page. I found a short code written in JavaScript which I suspect is the one responsible in removing the top frame whenever the page loads or redirects to google’s translation site.

I copied the code and tested on my draft blog which is hosted on my computer locally, To my surprise it worked and I want to share this with everyone who’s curious and want to get rid of the top frame whenever they want to translate a certain page or website this is helpful for webmasters and blogger’s as well.

Before I tell you how to do it let me warn you that it only works per one language. If you attempted to translate it to another while on the certain translated page an error will show up. As a temporary fix you need to go back to the home page as in the original URL of the site e.g. http://www.farneville.com then select another.

Without further ado here’s the small piece of code:


<script type='text/javascript'>
if (window.top !== window.self) {window.top.location = window.self.location;}
</script>

Simply paste it below the <body> tag of your site or blog and make sure you already have the translation widget or links before applying.

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s