<?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>Asheville Web Design &#187; prototype</title>
	<atom:link href="http://www.appliedtns.com/blog/tag/prototype/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.appliedtns.com/blog</link>
	<description>Asheville Web Design and Technology Blog</description>
	<lastBuildDate>Mon, 12 Dec 2011 21:56:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Automatic AJAX refresh/update with Prototype&#8217;s Ajax.PeriodicalUpdater</title>
		<link>http://www.appliedtns.com/blog/2008/11/automatic-ajax-refreshupdate-with-prototypes-ajaxperiodicalupdater/</link>
		<comments>http://www.appliedtns.com/blog/2008/11/automatic-ajax-refreshupdate-with-prototypes-ajaxperiodicalupdater/#comments</comments>
		<pubDate>Fri, 21 Nov 2008 14:52:14 +0000</pubDate>
		<dc:creator>Tony G.</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[automatic ajax]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[periodical]]></category>
		<category><![CDATA[prototype]]></category>
		<category><![CDATA[prototype.js]]></category>
		<category><![CDATA[refresh]]></category>
		<category><![CDATA[updater]]></category>

		<guid isPermaLink="false">http://asgblog.com/?p=19</guid>
		<description><![CDATA[The Prototype javascript library has a tight little method called Ajax.PeriodicalUpdater which will periodically perform an Ajax request at specified intervals. The format is nice and simple:

    var adbox = new Ajax.PeriodicalUpdater&#40;'adbox', 'http://'+location.host+'/ad',//the url
                   [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-size: small;"><span>The Prototype javascript library has a tight little method called Ajax.PeriodicalUpdater which will periodically perform an Ajax request at specified intervals. The format is nice and simple:</span></span></p>

<div class="wp_syntax"><div class="code"><pre class="javascript javascript" style="font-family:monospace;">    <span style="color:#DADEFB; font-weight:bold;">var</span> adbox <span style="color:#006600; font-weight:bold;">=</span> <span style="color:#DADEFB; font-weight:bold;">new</span> Ajax.<span style="color:#FFFFFF;">PeriodicalUpdater</span><span style="color:#AA66FF; font-weight:bold;">&#40;</span><span style="color:#A8FF60;">'adbox'</span><span style="color:#006600; font-weight:bold;">,</span> <span style="color:#A8FF60;">'http://'</span><span style="color:#006600; font-weight:bold;">+</span>location.<span style="color:#FFFFFF;">host</span><span style="color:#006600; font-weight:bold;">+</span><span style="color:#A8FF60;">'/ad'</span><span style="color:#006600; font-weight:bold;">,</span><span style="color:#E266E1; font-style:italic;">//the url</span>
                     <span style="color:#AA66FF; font-weight:bold;">&#123;</span>method<span style="color:#006600; font-weight:bold;">:</span> <span style="color:#A8FF60;">'get'</span><span style="color:#006600; font-weight:bold;">,</span> frequency<span style="color:#006600; font-weight:bold;">:</span> <span style="color:#006666;">5</span><span style="color:#AA66FF; font-weight:bold;">&#125;</span><span style="color:#E266E1; font-style:italic;">//this is the number of seconds.</span>
                <span style="color:#AA66FF; font-weight:bold;">&#41;</span>;</pre></div></div>

<p>In other words:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript javascript" style="font-family:monospace;">    <span style="color:#DADEFB; font-weight:bold;">var</span> updatername <span style="color:#006600; font-weight:bold;">=</span> <span style="color:#DADEFB; font-weight:bold;">new</span> Ajax.<span style="color:#FFFFFF;">PeriodicalUpdater</span><span style="color:#AA66FF; font-weight:bold;">&#40;</span><span style="color:#A8FF60;">'divid'</span><span style="color:#006600; font-weight:bold;">,</span> <span style="color:#A8FF60;">'url'</span><span style="color:#006600; font-weight:bold;">,</span>
                     <span style="color:#AA66FF; font-weight:bold;">&#123;</span>method<span style="color:#006600; font-weight:bold;">:</span> <span style="color:#A8FF60;">'get'</span><span style="color:#006600; font-weight:bold;">,</span> frequency<span style="color:#006600; font-weight:bold;">:</span> seconds<span style="color:#AA66FF; font-weight:bold;">&#125;</span>
                <span style="color:#AA66FF; font-weight:bold;">&#41;</span>;</pre></div></div>

<p>Its a good idea to use location.host to build the URL as visitors may access your domain directly instead of using www, etc.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.appliedtns.com/blog/2008/11/automatic-ajax-refreshupdate-with-prototypes-ajaxperiodicalupdater/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

