<?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>Make Money Blogging Tips For Free &#187; Javascript</title>
	<atom:link href="http://webmasterweblog.com/category/programming/javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://webmasterweblog.com</link>
	<description>Experiences of a Webmaster</description>
	<lastBuildDate>Mon, 01 Mar 2010 13:16:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Popup Script Javascript</title>
		<link>http://webmasterweblog.com/popup-script-javascript.html</link>
		<comments>http://webmasterweblog.com/popup-script-javascript.html#comments</comments>
		<pubDate>Sat, 12 Sep 2009 15:22:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://webmasterweblog.com/?p=244</guid>
		<description><![CDATA[We all hate them, yet there&#8217;s no way around them .. sometimes. Well, actually sometimes they can be even useful. What if you are programming a web 2.0 site and want to create some neat popups that explain how this or that works? Popups can also come in handy if you want to make sure that visitors to your blog don&#8217;t miss any important information.
Anyway, after looking around I found two solutions. From now on, I&#8217;ll always differentiate between the &#8220;Blogger solution&#8221; and the &#8220;Marketeer solution&#8221;. If you don&#8217;t know ...]]></description>
			<content:encoded><![CDATA[<p>We all hate them, yet there&#8217;s no way around them .. sometimes. Well, actually sometimes they can be even useful. What if you are programming a web 2.0 site and want to create some neat popups that explain how this or that works? Popups can also come in handy if you want to make sure that visitors to your blog don&#8217;t miss any important information.</p>
<p>Anyway, after looking around I found two solutions. From now on, I&#8217;ll always differentiate between the &#8220;Blogger solution&#8221; and the &#8220;Marketeer solution&#8221;. If you don&#8217;t know why I am doing that, I suggest you subscribe to our mailing list and grab your free eBook.<br />
<span id="more-244"></span></p>
<h3><strong>Popup Script in Javascript for Bloggers</strong></h3>
<p>The following script is intended for bloggers. This is *not* a popup that will automatically popup, although you could probably modify the code so it does, but it is a neat plugin that helps you to open a windows &#8220;on click&#8221;.</p>
<p>A link would look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>a onclick<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;superPopup({url:this.href, type: 'someGroup'}); return false;&quot;</span> href<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;popup_window_url.html&quot;</span><span style="color: #339933;">&gt;</span>link text<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span></pre></div></div>

<p>Eric &#8220;Webstar&#8221;&#8217;s Superpopup: <a href="http://www.ericwebster.net/2007/03/superpopup_the_last_popup_scri.php" >http://www.ericwebster.net/</a></p>
<h3><strong>Popup Script in Javascript for Marketeers</strong></h3>
<p>Looking for a popup that is unblockable? Looking for a way to open up a little advertising window that can will open:</p>
<p>a) once per browser session<br />
b) every site refresh<br />
c) once every &#8220;x&#8221; minutes</p>
<p>If so, then you might want to look into this little script:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript javascript" style="font-family:monospace;">	<span style="color: #003366; font-weight: bold;">var</span> nba_pop_toolbar <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">typeof</span> nba_pop_toolbar <span style="color: #339933;">!=</span> <span style="color: #3366CC;">'undefined'</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> nba_pop_toolbar <span style="color: #339933;">:</span> 0;
	<span style="color: #003366; font-weight: bold;">var</span> nba_pop_status <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">typeof</span> nba_pop_status <span style="color: #339933;">!=</span> <span style="color: #3366CC;">'undefined'</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> nba_pop_status <span style="color: #339933;">:</span> 0;
	<span style="color: #003366; font-weight: bold;">var</span> nba_pop_menubar <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">typeof</span> nba_pop_menubar <span style="color: #339933;">!=</span> <span style="color: #3366CC;">'undefined'</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> nba_pop_menubar <span style="color: #339933;">:</span> 0;
	<span style="color: #003366; font-weight: bold;">var</span> nba_pop_scrollbars <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">typeof</span> nba_pop_scrollbars <span style="color: #339933;">!=</span> <span style="color: #3366CC;">'undefined'</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> nba_pop_scrollbars <span style="color: #339933;">:</span> 0;
	<span style="color: #003366; font-weight: bold;">var</span> nba_pop_resizable <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">typeof</span> nba_pop_resizable <span style="color: #339933;">!=</span> <span style="color: #3366CC;">'undefined'</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> nba_pop_resizable <span style="color: #339933;">:</span> <span style="color: #CC0000;">1</span>;
	<span style="color: #003366; font-weight: bold;">var</span> nba_pop_page_delay <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">typeof</span> nba_pop_page_delay <span style="color: #339933;">!=</span> <span style="color: #3366CC;">'undefined'</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> nba_pop_page_delay <span style="color: #339933;">:</span> <span style="color: #CC0000;">1</span>;
	<span style="color: #003366; font-weight: bold;">var</span> nba_pop_limit <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">typeof</span> nba_pop_limit <span style="color: #339933;">!=</span> <span style="color: #3366CC;">'undefined'</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> nba_pop_limit <span style="color: #339933;">:</span> <span style="color: #3366CC;">'session'</span>;
	<span style="color: #003366; font-weight: bold;">var</span> nba_pop_type <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">typeof</span> nba_pop_type <span style="color: #339933;">!=</span> <span style="color: #3366CC;">'undefined'</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> nba_pop_type <span style="color: #339933;">:</span> <span style="color: #3366CC;">'over'</span>;
&nbsp;
	<span style="color: #003366; font-weight: bold;">var</span> nba_ie <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span>;
	<span style="color: #003366; font-weight: bold;">var</span> nba_popped <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span>;
&nbsp;
	<span style="color: #003366; font-weight: bold;">function</span> nba_launch<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> nba_get_cookie<span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'nba_pop'</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #003366; font-weight: bold;">false</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>amp;&amp;amp; <span style="color: #009900;">&#40;</span> nba_popped <span style="color: #339933;">==</span> <span style="color: #003366; font-weight: bold;">false</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			nba_set_cookie<span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'nba_pop'</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span> <span style="color: #009900;">&#41;</span>;
			nba_popped <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span>;
			window.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span> nba_url<span style="color: #339933;">,</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'height='</span> <span style="color: #339933;">+</span> nba_pop_height <span style="color: #339933;">+</span> <span style="color: #3366CC;">',width='</span> <span style="color: #339933;">+</span> nba_pop_width <span style="color: #339933;">+</span> <span style="color: #3366CC;">',left='</span> <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> screen.<span style="color: #660066;">width</span> <span style="color: #339933;">-</span> nba_pop_width <span style="color: #009900;">&#41;</span> <span style="color: #009966; font-style: italic;">/ 2 ) + ',top=' + ( ( screen.height - nba_pop_height ) /</span> <span style="color: #CC0000;">2</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">',toolbar='</span> <span style="color: #339933;">+</span> nba_pop_toolbar <span style="color: #339933;">+</span> <span style="color: #3366CC;">',status='</span> <span style="color: #339933;">+</span> nba_pop_status <span style="color: #339933;">+</span> <span style="color: #3366CC;">',menubar='</span> <span style="color: #339933;">+</span> nba_pop_menubar <span style="color: #339933;">+</span> <span style="color: #3366CC;">',scrollbars='</span> <span style="color: #339933;">+</span> nba_pop_scrollbars <span style="color: #339933;">+</span> <span style="color: #3366CC;">',resizable='</span> <span style="color: #339933;">+</span> nba_pop_resizable <span style="color: #009900;">&#41;</span>;
			<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> nba_pop_type <span style="color: #339933;">==</span> <span style="color: #3366CC;">'under'</span> <span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#123;</span>
				window.<span style="color: #000066;">focus</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
				window.<span style="color: #660066;">setTimeout</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'window.focus()'</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">100</span> <span style="color: #009900;">&#41;</span>;
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #003366; font-weight: bold;">var</span> nba_url <span style="color: #339933;">=</span> <span style="color: #3366CC;">'http://domain.com'</span> ;
	<span style="color: #003366; font-weight: bold;">function</span> nba_init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> navigator.<span style="color: #660066;">appVersion</span>.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'MSIE'</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span> <span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			nba_ie <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span>;
		<span style="color: #009900;">&#125;</span>
		window.<span style="color: #660066;">setTimeout</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'nba_trigger()'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#40;</span> nba_pop_page_delay <span style="color: #339933;">*</span> <span style="color: #CC0000;">1000</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>;
	<span style="color: #009900;">&#125;</span>
	<span style="color: #003366; font-weight: bold;">function</span> nba_trigger<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> nba_ie <span style="color: #339933;">==</span> <span style="color: #003366; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'nba_field'</span> <span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fireEvent</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'onchange'</span> <span style="color: #009900;">&#41;</span>;
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #003366; font-weight: bold;">function</span> nba_set_cookie<span style="color: #009900;">&#40;</span> <span style="color: #000066;">name</span><span style="color: #339933;">,</span> value <span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> expires <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span>;
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> nba_pop_limit <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">false</span> <span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">typeof</span><span style="color: #009900;">&#40;</span> nba_pop_limit <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">'number'</span> <span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#123;</span>
				<span style="color: #003366; font-weight: bold;">var</span> d <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Date<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
				d.<span style="color: #660066;">setTime</span><span style="color: #009900;">&#40;</span> d.<span style="color: #660066;">getTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> nba_pop_limit <span style="color: #339933;">*</span> <span style="color: #CC0000;">60</span> <span style="color: #339933;">*</span> <span style="color: #CC0000;">1000</span> <span style="color: #009900;">&#41;</span>;
				expires <span style="color: #339933;">=</span> <span style="color: #3366CC;">'; expires='</span> <span style="color: #339933;">+</span> d.<span style="color: #660066;">toGMTString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
			<span style="color: #009900;">&#125;</span>
			document.<span style="color: #660066;">cookie</span> <span style="color: #339933;">=</span> <span style="color: #000066;">name</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'='</span> <span style="color: #339933;">+</span> escape<span style="color: #009900;">&#40;</span> value <span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> expires <span style="color: #339933;">+</span> <span style="color: #3366CC;">'; path=/'</span>;
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #003366; font-weight: bold;">function</span> nba_get_cookie<span style="color: #009900;">&#40;</span> <span style="color: #000066;">name</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> re <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> RegExp<span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'(<span style="color: #000099; font-weight: bold;">\;</span>|^)[^;]*('</span> <span style="color: #339933;">+</span> <span style="color: #000066;">name</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">')<span style="color: #000099; font-weight: bold;">\=</span>([^;]*)(;|$)'</span> <span style="color: #009900;">&#41;</span>;
		<span style="color: #003366; font-weight: bold;">var</span> res <span style="color: #339933;">=</span> re.<span style="color: #660066;">exec</span><span style="color: #009900;">&#40;</span> document.<span style="color: #660066;">cookie</span> <span style="color: #009900;">&#41;</span>;
		<span style="color: #000066; font-weight: bold;">return</span> res <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">null</span> <span style="color: #339933;">?</span> unescape<span style="color: #009900;">&#40;</span> res<span style="color: #009900;">&#91;</span> <span style="color: #CC0000;">3</span> <span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span>;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #003366; font-weight: bold;">var</span> nba_body <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'BODY'</span> <span style="color: #009900;">&#41;</span>.<span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#40;</span> 0 <span style="color: #009900;">&#41;</span>;
	window.<span style="color: #000066;">onload</span> <span style="color: #339933;">=</span> nba_init;
	window.<span style="color: #660066;">onclick</span> <span style="color: #339933;">=</span> nba_launch;
	document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'&lt;input id=&quot;nba_field&quot; style=&quot;width: 0px; top: 0px; position: absolute; visibility: hidden;&quot; /&gt;'</span> <span style="color: #009900;">&#41;</span>;</pre></div></div>

<p>Now that&#8217;s quite a long script and you will have to call it like that:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;&lt;!--</span>mce<span style="color: #339933;">:</span>0<span style="color: #339933;">--&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p>Uncomment whatever you need</p>

<div class="wp_syntax"><div class="code"><pre class="javascript javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">//var nba_pop_limit = 1; //once every x minutes</span>
<span style="color: #006600; font-style: italic;">//var nba_pop_limit = false; //every page load</span>
<span style="color: #003366; font-weight: bold;">var</span> nba_pop_limit <span style="color: #339933;">=</span> <span style="color: #3366CC;">'session'</span>; <span style="color: #006600; font-style: italic;">//once every browser session</span></pre></div></div>

<p>You need to specify your URL in the first snippet, modify nba_url:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> nba_url <span style="color: #339933;">=</span> <span style="color: #3366CC;">'http://domain.com'</span> ;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://webmasterweblog.com/popup-script-javascript.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unblockable Pop Under Script</title>
		<link>http://webmasterweblog.com/unblockable-pop-under.html</link>
		<comments>http://webmasterweblog.com/unblockable-pop-under.html#comments</comments>
		<pubDate>Sat, 13 Jun 2009 09:03:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://webmasterweblog.com/?p=180</guid>
		<description><![CDATA[No worries, I won&#8217;t add any popunder to this site. However, a pop under is still a good marketing strategy for some sites where you want to make sure that visitors don&#8217;t miss that very special offer!
Most of the scripts you will find on the net are blocked automatically by Firefox and IE7+8.
It&#8217;s a bit sneaky to be honest and I recommend to use it rarely and only if you are sure that visitors don&#8217;t know what popunders are. This script will send out a welcome message your visitor has ...]]></description>
			<content:encoded><![CDATA[<p>No worries, I won&#8217;t add any popunder to this site. However, a pop under is still a good marketing strategy for some sites where you want to make sure that visitors don&#8217;t miss that very special offer!</p>
<p>Most of the scripts you will find on the net are blocked automatically by Firefox and IE7+8.<br />
It&#8217;s a bit sneaky to be honest and I recommend to use it rarely and only if you are sure that visitors don&#8217;t know what popunders are. This script will send out a welcome message your visitor has to close. When the visitor does that he allows the browser to load the pop under beneath the current windows. Smart, eh? </p>
<p>I&#8217;ve found the script on this site:<br />
<a href="http://www.guysindex.com/nerdy/how-to-make-an-unblockable-popunder-script.html" >http://www.guysindex.com/</a><br />
<span id="more-180"></span></p>

<div class="wp_syntax"><div class="code"><pre class="javascript javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>head<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">'text/javascript'</span><span style="color: #339933;">&gt;</span>
<span style="color: #003366; font-weight: bold;">function</span> doOpen<span style="color: #009900;">&#40;</span>url<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>get_cookie<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'popunder'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #006600; font-style: italic;">// attempt to open the popup</span>
win <span style="color: #339933;">=</span> window.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>url<span style="color: #339933;">,</span> <span style="color: #3366CC;">'test'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'toolbar,status,resizable,scrollbars,menubar,location,height=600,width=800'</span><span style="color: #009900;">&#41;</span>;
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>win<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #006600; font-style: italic;">// popup successfully created</span>
win.<span style="color: #000066;">blur</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
setTimeout<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'win.focus();'</span><span style="color: #339933;">,</span><span style="color: #CC0000;">10000</span><span style="color: #009900;">&#41;</span>;
<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
<span style="color: #006600; font-style: italic;">// popup was not created.</span>
showPopupMessage<span style="color: #009900;">&#40;</span>url<span style="color: #009900;">&#41;</span>;
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">var</span> today <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Date<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
today.<span style="color: #660066;">setTime</span><span style="color: #009900;">&#40;</span> today.<span style="color: #660066;">getTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>;
expires <span style="color: #339933;">=</span> <span style="color: #CC0000;">1</span> <span style="color: #339933;">*</span> <span style="color: #CC0000;">1000</span> <span style="color: #339933;">*</span> <span style="color: #CC0000;">60</span> <span style="color: #339933;">*</span> <span style="color: #CC0000;">60</span> <span style="color: #339933;">*</span> <span style="color: #CC0000;">24</span>;
<span style="color: #003366; font-weight: bold;">var</span> expires_date <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Date<span style="color: #009900;">&#40;</span> today.<span style="color: #660066;">getTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span>expires<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>;
document.<span style="color: #660066;">cookie</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;popunder=yes;expires=&quot;</span> <span style="color: #339933;">+</span> expires_date.<span style="color: #660066;">toGMTString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066; font-weight: bold;">return</span> win;
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #003366; font-weight: bold;">var</span> win <span style="color: #339933;">=</span> doOpen<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'http://www.yoursite.com/'</span><span style="color: #009900;">&#41;</span>;
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> showPopupMessage<span style="color: #009900;">&#40;</span>url<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #000066; font-weight: bold;">return</span>;
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">var</span> elmDiv <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div'</span><span style="color: #009900;">&#41;</span>;
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span><span style="color: #009900;">&#40;</span>elmDiv.<span style="color: #660066;">innerHTML</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #3366CC;">'string'</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #000066; font-weight: bold;">return</span>;
<span style="color: #009900;">&#125;</span>
elmDiv.<span style="color: #660066;">id</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'popupmessage'</span>;
elmDiv.<span style="color: #660066;">style</span>.<span style="color: #660066;">cssText</span> <span style="color: #339933;">=</span>
<span style="color: #3366CC;">'position: absolute; left: 300px; top: 225px;'</span> <span style="color: #339933;">+</span>
<span style="color: #3366CC;">'width: 350px;'</span> <span style="color: #339933;">+</span>
<span style="color: #3366CC;">'color: 000099; '</span> <span style="color: #339933;">+</span>
<span style="color: #3366CC;">'background-color: white; '</span> <span style="color: #339933;">+</span>
<span style="color: #3366CC;">'font-weight: bold; '</span> <span style="color: #339933;">+</span>
<span style="color: #3366CC;">'font-size: 14; '</span> <span style="color: #339933;">+</span>
<span style="color: #3366CC;">'border: solid black 2px; '</span> <span style="color: #339933;">+</span>
<span style="color: #3366CC;">'padding: 1em;'</span>;
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> html <span style="color: #339933;">=</span> <span style="color: #3366CC;">'Thank you for visiting this-site.com. '</span> <span style="color: #339933;">+</span>
<span style="color: #3366CC;">'Please enjoy your stay. '</span> <span style="color: #339933;">+</span>
<span style="color: #3366CC;">'Visit back tomorrow for more exciting news! '</span> <span style="color: #339933;">+</span>
&nbsp;
<span style="color: #3366CC;">'&lt;p align=&quot;right&quot;&gt;'</span> <span style="color: #339933;">+</span>
<span style="color: #3366CC;">'&lt;a href=&quot;#&quot; '</span> <span style="color: #339933;">+</span>
<span style="color: #3366CC;">'onclick=&quot;document.cookie=<span style="color: #000099; font-weight: bold;">\'</span>popunder=<span style="color: #000099; font-weight: bold;">\'</span>; win = doOpen(<span style="color: #000099; font-weight: bold;">\'</span>'</span> <span style="color: #339933;">+</span> url <span style="color: #339933;">+</span> <span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\'</span>); hidePopupMessage(); return false;&quot;&gt;'</span> <span style="color: #339933;">+</span>
<span style="color: #3366CC;">'close&lt;/a&gt;'</span> <span style="color: #339933;">+</span>
&nbsp;
<span style="color: #3366CC;">'&lt;<span style="color: #000099; font-weight: bold;">\/</span>div&gt;'</span>;
document.<span style="color: #660066;">body</span>.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>elmDiv<span style="color: #009900;">&#41;</span>;
elmDiv.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> html;
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> hidePopupMessage<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #003366; font-weight: bold;">var</span> elmDiv <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'popupmessage'</span><span style="color: #009900;">&#41;</span>;
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>elmDiv<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
elmDiv.<span style="color: #660066;">parentNode</span>.<span style="color: #660066;">removeChild</span><span style="color: #009900;">&#40;</span>elmDiv<span style="color: #009900;">&#41;</span>;
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> get_cookie<span style="color: #009900;">&#40;</span><span style="color: #000066;">Name</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #003366; font-weight: bold;">var</span> search <span style="color: #339933;">=</span> <span style="color: #000066;">Name</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;=&quot;</span>
<span style="color: #003366; font-weight: bold;">var</span> returnvalue <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;&quot;</span>;
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">cookie</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> 0<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
offset <span style="color: #339933;">=</span> document.<span style="color: #660066;">cookie</span>.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span>search<span style="color: #009900;">&#41;</span>
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>offset <span style="color: #339933;">!=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// if the cookie exists</span>
offset <span style="color: #339933;">+=</span> search.<span style="color: #660066;">length</span>
end <span style="color: #339933;">=</span> document.<span style="color: #660066;">cookie</span>.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;;&quot;</span><span style="color: #339933;">,</span> offset<span style="color: #009900;">&#41;</span>; <span style="color: #006600; font-style: italic;">// set the index of beginning value</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>end <span style="color: #339933;">==</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #006600; font-style: italic;">// set the index of the end of cookie value</span>
end <span style="color: #339933;">=</span> document.<span style="color: #660066;">cookie</span>.<span style="color: #660066;">length</span>;
returnvalue<span style="color: #339933;">=</span>unescape<span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">cookie</span>.<span style="color: #660066;">substring</span><span style="color: #009900;">&#40;</span>offset<span style="color: #339933;">,</span> end<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066; font-weight: bold;">return</span> returnvalue;
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>head<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>body <span style="color: #000066;">onload</span><span style="color: #339933;">=</span><span style="color: #3366CC;">'init()'</span><span style="color: #339933;">&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://webmasterweblog.com/unblockable-pop-under.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Aweber Javascript errors crash Internet Explorer</title>
		<link>http://webmasterweblog.com/aweber-javascript-errors-crash-internet-explorer.html</link>
		<comments>http://webmasterweblog.com/aweber-javascript-errors-crash-internet-explorer.html#comments</comments>
		<pubDate>Fri, 12 Jun 2009 06:08:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Aweber]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://webmasterweblog.com/?p=176</guid>
		<description><![CDATA[I&#8217;ve been using Aweber for a while and they are definetly a must have nowadays for any real webmaster.
However, I think Aweber is doing their best to loose as many clients as possible.
First of all they increased the price to ridiculous high amounts. Any smart person knows that there are Aweber PLR sites, which still offer the old price e.g. Profollow (ProSender sucks they have the new price). 
Then today I noticed a major flaw (I almost freaked out). Your fancy aweber scripts makes the internet explorer crash. Can you ...]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using Aweber for a while and they are definetly a must have nowadays for any real webmaster.</p>
<p>However, I think Aweber is doing their best to loose as many clients as possible.</p>
<p>First of all they increased the price to ridiculous high amounts. Any smart person knows that there are Aweber PLR sites, which still offer the old price e.g. Profollow (ProSender sucks they have the new price). </p>
<p>Then today I noticed a major flaw (I almost freaked out). Your fancy aweber scripts makes the internet explorer crash. Can you even imagine that? They are in business for 10 years+ and they make your sites crash. Ridiculous. Sorry, but I&#8217;m very disappointed. It was sheer luck that I noticed it and I already lost tons of visitors because of that.<br />
<strong><br />
Errors:</strong><br />
Javascript error: &#8220;Object not found&#8221;. (IE8)<br />
Javascript error: Internet Explorer Cannot Open the Internet Site Operation Aborted. (IE7) &#8211; Some sources say Kontera has the same problem.</p>
<p>Luckily, I do not give up that easily. I found a workaround for the second error. </p>
<p>Add this to your javascript code:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript javascript" style="font-family:monospace;">defer<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;defer&quot;</span></pre></div></div>

<p>It could look like this now:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://forms.profollow.com/form/xx/xxxx.js&quot;</span> defer<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;defer&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p>What is Javascript &#8220;defer&#8221;? <a href="http://www.websiteoptimization.com/speed/tweak/defer/" >Defer explained </a></p>
]]></content:encoded>
			<wfw:commentRss>http://webmasterweblog.com/aweber-javascript-errors-crash-internet-explorer.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>GET URL parameter via Javascript</title>
		<link>http://webmasterweblog.com/get-url-parameter-via-javascript.html</link>
		<comments>http://webmasterweblog.com/get-url-parameter-via-javascript.html#comments</comments>
		<pubDate>Sat, 20 Dec 2008 18:35:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://webmasterweblog.com/?p=126</guid>
		<description><![CDATA[If you want to retrieve various URL parameters without using PHP you can also do it via Javascript.

The following function can be used to do that:
Source

function gup&#40; name &#41;&#123;  name = name.replace&#40;/[\[]/,&#34;\\\[&#34;&#41;.replace&#40;/[\]]/,&#34;\\\]&#34;&#41;;  var regexS = &#34;[\\?&#38;]&#34;+name+&#34;=([^&#38;#]*)&#34;;  var regex = new RegExp&#40; regexS &#41;;  var results = regex.exec&#40; window.location.href &#41;;  if&#40; results == null &#41;    return &#34;&#34;;  else    return results&#91;1&#93;;&#125;

To get the value simply call it this way:

var frank_param = gup&#40; 'frank' &#41;;

Another easy solution would be to do ...]]></description>
			<content:encoded><![CDATA[<p>If you want to retrieve various URL parameters without using PHP you can also do it via Javascript.</p>
<p><span id="more-126"></span></p>
<p>The following function can be used to do that:<br />
<a href="http://www.netlobo.com/url_query_string_javascript.html"  target="_blank">Source</a><br/></p>

<div class="wp_syntax"><div class="code"><pre class="javascript javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> gup<span style="color: #009900;">&#40;</span> <span style="color: #000066;">name</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>  <span style="color: #000066;">name</span> <span style="color: #339933;">=</span> <span style="color: #000066;">name</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/[\[]/</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\\</span><span style="color: #000099; font-weight: bold;">\[</span>&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/[\]]/</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\\</span><span style="color: #000099; font-weight: bold;">\]</span>&quot;</span><span style="color: #009900;">&#41;</span>;  <span style="color: #003366; font-weight: bold;">var</span> regexS <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;[<span style="color: #000099; font-weight: bold;">\\</span>?&amp;]&quot;</span><span style="color: #339933;">+</span><span style="color: #000066;">name</span><span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;=([^&amp;#]*)&quot;</span>;  <span style="color: #003366; font-weight: bold;">var</span> regex <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> RegExp<span style="color: #009900;">&#40;</span> regexS <span style="color: #009900;">&#41;</span>;  <span style="color: #003366; font-weight: bold;">var</span> results <span style="color: #339933;">=</span> regex.<span style="color: #660066;">exec</span><span style="color: #009900;">&#40;</span> window.<span style="color: #660066;">location</span>.<span style="color: #660066;">href</span> <span style="color: #009900;">&#41;</span>;  <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> results <span style="color: #339933;">==</span> <span style="color: #003366; font-weight: bold;">null</span> <span style="color: #009900;">&#41;</span>    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #3366CC;">&quot;&quot;</span>;  <span style="color: #000066; font-weight: bold;">else</span>    <span style="color: #000066; font-weight: bold;">return</span> results<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span>;<span style="color: #009900;">&#125;</span></pre></div></div>

<p>To get the value simply call it this way:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> frank_param <span style="color: #339933;">=</span> gup<span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'frank'</span> <span style="color: #009900;">&#41;</span>;</pre></div></div>

<p>Another easy solution would be to do it via PHP but it&#8217;s not as elegant:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;javascript&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;!--</span>
<span style="color: #339933;">&lt;?</span>php 
echo<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;firstVar = $var1;&quot;</span><span style="color: #009900;">&#41;</span>;
echo<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;2ndVar = $var2;&quot;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #339933;">?&gt;</span>
<span style="color: #006600; font-style: italic;">// --&gt;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://webmasterweblog.com/get-url-parameter-via-javascript.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
