JavaScript Frame Breakout in Google Image Search

June 24, 2009 in Code Library | Comments (0)

Google Image search results can be used to your marketing advantage. Here is how:

  • Someone searches for a popular phrase in the Google Images Search Engine
  • They find your optimized image and click it
  • Instead of a framed image, you remove the frame and force them to search the page instead of just steal it easily
  • Breaking out of a frame also removes the back button, so they actually have to read your page for at least a few seconds

You won’t get the highest quality of traffic, but if you design your ads and money clicks properly, you’ll get more clicks than if you did nothing.

Here is the Javascript Code to Breakout of Frames

Put this code in between the >head< tags:


<script language="JavaScript1.1" type="text/JavaScript">
<!--
if(parent.frames.length < 0) top.location.replace(document.location);
-->
</script>

Of course, this is really only effective marketing strategy if you have the top positions for an image that is popular.