<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ifwebstudio blog &#187; Javascript</title>
	<atom:link href="http://blog.ifwebstudio.com/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ifwebstudio.com</link>
	<description>PHP, SEO, Web Design</description>
	<lastBuildDate>Tue, 08 Dec 2009 18:27:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Frame busting code and AdSense</title>
		<link>http://blog.ifwebstudio.com/javascript/frame-busting-code-and-adsense/</link>
		<comments>http://blog.ifwebstudio.com/javascript/frame-busting-code-and-adsense/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 19:58:40 +0000</pubDate>
		<dc:creator>Ilir Fekaj</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://blog.ifwebstudio.com/?p=30</guid>
		<description><![CDATA[If you are tired of your site being framed by other sites or image search engines, you would certainly have thought of using some of Javascript code to kill unwanted frame. However, there is concern that this code may cause double page impression of your AdSense or other ads. To test this, I created a [...]]]></description>
			<content:encoded><![CDATA[<p>If you are tired of your site being framed by other sites or image search engines, you would certainly have thought of using some of Javascript code to kill unwanted frame. However, there is concern that this code may cause double page impression of your AdSense or other ads. To test this, I created a small experiment by adding Javascript alert near the end of my page so it runs after frame killer/redirect occurs. To my surprise, Chrome, Opera and Safari loaded two alert boxes, which effectively proved that all Javascript (including ads) is fired up twice. I  solved this problem (hopefully) by stopping execution of all scripts after redirection. Here is my final code:</p>
<pre name="code" class="javascript">
if (top.location != self.location) {
top.location.replace(self.location);
if(navigator.appName == "Microsoft Internet Explorer"){
window.document.execCommand('Stop');
}
else{
window.stop();
}
}
</pre>
<p>Please let me know what you think.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Frame+busting+code+and+AdSense+http://cy4rs.th8.us" title="Post to Twitter"><img class="nothumb" src="http://blog.ifwebstudio.com/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Frame+busting+code+and+AdSense+http://cy4rs.th8.us" title="Post to Twitter">Tweet This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.ifwebstudio.com/javascript/frame-busting-code-and-adsense/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
