<?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>Web Development &#38; Stuff &#187; Javascript</title>
	<atom:link href="http://web-development-blog.co.uk/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://web-development-blog.co.uk</link>
	<description>Some interesting findings from web-dev land...</description>
	<lastBuildDate>Mon, 02 Apr 2012 15:10:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>CKEditor in iFrame / jQuery UI dialog top offset bug</title>
		<link>http://web-development-blog.co.uk/2010/10/15/ckeditor-in-iframe-jquery-ui-dialog-top-offset-bug/</link>
		<comments>http://web-development-blog.co.uk/2010/10/15/ckeditor-in-iframe-jquery-ui-dialog-top-offset-bug/#comments</comments>
		<pubDate>Fri, 15 Oct 2010 16:37:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://web-development-blog.co.uk/?p=395</guid>
		<description><![CDATA[I had a couple of CKEditors in a jQuery UI dialog box today. The dialog box contained an iFrame with the actual CKEditors inside that.
On the odd occasion when the modal box opened (tested in FireFox 3.6 on the Mac and PC) the vertical scroll position of the iFrame would not be at the top. [...]]]></description>
			<content:encoded><![CDATA[<p>I had a couple of CKEditors in a jQuery UI dialog box today. The dialog box contained an iFrame with the actual CKEditors inside that.</p>
<p>On the odd occasion when the modal box opened (tested in FireFox 3.6 on the Mac and PC) the vertical scroll position of the iFrame would not be at the top. Instead it was focused on one of the lower CKEditors.</p>
<p>After some Googling and hacking and still no solution I placed this in each CKeditor onReady/instanceReady callback, which did the trick:</p>
<div class="codecolorer-container php " style="overflow:auto;white-space:nowrap;width:100%"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br /></div></td><td><div class="php codecolorer" style="font-family:Monaco,Lucida Console,monospace">CKEditor<span class="sy0">.</span>on<span class="br0">&#40;</span><span class="st0">&quot;instanceReady&quot;</span><span class="sy0">,</span> <span class="kw2">function</span><span class="br0">&#40;</span>event<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; $<span class="br0">&#40;</span>window<span class="br0">&#41;</span><span class="sy0">.</span>scrollTop<span class="br0">&#40;</span><span class="nu0">0</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://web-development-blog.co.uk/2010/10/15/ckeditor-in-iframe-jquery-ui-dialog-top-offset-bug/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Stop Javascript event bubbling / propagation with nested html elements using jQuery</title>
		<link>http://web-development-blog.co.uk/2010/07/28/stop-javascript-event-bubbling-propagation-nested-html-elements/</link>
		<comments>http://web-development-blog.co.uk/2010/07/28/stop-javascript-event-bubbling-propagation-nested-html-elements/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 13:51:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://web-development-blog.co.uk/?p=359</guid>
		<description><![CDATA[You can stop nested elements triggering their parent element event handlers (DOM bubbling) using this handy jQuery method:
http://api.jquery.com/event.stopImmediatePropagation/
I ran into this issue whilst working on a calendar/scheduling app. Where day containing elements needed click events and their child elements needed click events too. 
Love the jQuery ;]
]]></description>
			<content:encoded><![CDATA[<p>You can stop nested elements triggering their parent element event handlers (DOM bubbling) using this handy jQuery method:</p>
<p><a href="http://api.jquery.com/event.stopImmediatePropagation/">http://api.jquery.com/event.stopImmediatePropagation/</a></p>
<p>I ran into this issue whilst working on a calendar/scheduling app. Where day containing elements needed click events and their child elements needed click events too. </p>
<p>Love the jQuery ;]</p>
]]></content:encoded>
			<wfw:commentRss>http://web-development-blog.co.uk/2010/07/28/stop-javascript-event-bubbling-propagation-nested-html-elements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t trust the output of innerHTML() or jQuery.html() in Internet Explorer</title>
		<link>http://web-development-blog.co.uk/2010/05/16/dont-trust-the-output-of-innerhtml-or-jquery-html-in-internet-explorer/</link>
		<comments>http://web-development-blog.co.uk/2010/05/16/dont-trust-the-output-of-innerhtml-or-jquery-html-in-internet-explorer/#comments</comments>
		<pubDate>Sun, 16 May 2010 13:52:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://web-development-blog.co.uk/?p=341</guid>
		<description><![CDATA[Especially if you&#8217;re trying to match attributes and their values!
Thankfully Kooilnc, the godsend has a solution:
http://stackoverflow.com/questions/1231770/innerhtml-removes-attribute-quotes-in-internet-explorer
I&#8217;ve wrapped that up into a jQuery function here:
123456789101112131415161718192021222324$.fn.ieInnerHTML = function&#40;&#41; &#123; 
&#160; var zz = this.html&#40;&#41;,
&#160; &#160; &#160; &#160;z = 
&#160; &#160; &#160;zz.match&#40;/&#60;\/?\w+((\s+\w+(\s*=\s*(?:&#34;.*?&#34;&#124;'.*?'&#124;[^'&#34;&#62;\s]+))?)+\s*&#124;\s*)\/?&#62;/g&#41;;
&#160; &#160; if &#40;z&#41;&#123;
&#160; &#160; &#160; for &#40;var i=0;i&#60;z.length;i++&#41;&#123;
&#160; &#160; &#160; &#160; var y, zSaved = z&#91;i&#93;;
&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Especially if you&#8217;re trying to match attributes and their values!</p>
<p>Thankfully Kooilnc, the godsend has a solution:</p>
<p><a href="http://stackoverflow.com/questions/1231770/innerhtml-removes-attribute-quotes-in-internet-explorer">http://stackoverflow.com/questions/1231770/innerhtml-removes-attribute-quotes-in-internet-explorer</a></p>
<p>I&#8217;ve wrapped that up into a jQuery function here:</p>
<div class="codecolorer-container javascript " style="overflow:auto;white-space:nowrap;width:100%;height:300px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br /></div></td><td><div class="javascript codecolorer" style="font-family:Monaco,Lucida Console,monospace">$.<span class="me1">fn</span>.<span class="me1">ieInnerHTML</span> <span class="sy0">=</span> <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> <br />
&nbsp; <span class="kw2">var</span> zz <span class="sy0">=</span> <span class="kw1">this</span>.<span class="me1">html</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;z <span class="sy0">=</span> <br />
&nbsp; &nbsp; &nbsp;zz.<span class="me1">match</span><span class="br0">&#40;</span><span class="co2">/&lt;\/?\w+((\s+\w+(\s*=\s*(?:&quot;.*?&quot;|'.*?'|[^'&quot;&gt;\s]+))?)+\s*|\s*)\/?&gt;/g</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>z<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw2">var</span> i<span class="sy0">=</span><span class="nu0">0</span><span class="sy0">;</span>i<span class="sy0">&lt;</span>z.<span class="me1">length</span><span class="sy0">;</span>i<span class="sy0">++</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> y<span class="sy0">,</span> zSaved <span class="sy0">=</span> z<span class="br0">&#91;</span>i<span class="br0">&#93;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; z<span class="br0">&#91;</span>i<span class="br0">&#93;</span> <span class="sy0">=</span> z<span class="br0">&#91;</span>i<span class="br0">&#93;</span>.<span class="me1">replace</span><span class="br0">&#40;</span><span class="co2">/(&lt;?\w+)|(&lt;\/?\w+)\s/</span><span class="sy0">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">function</span><span class="br0">&#40;</span>a<span class="br0">&#41;</span><span class="br0">&#123;</span><span class="kw1">return</span> a.<span class="me1">toLowerCase</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; y <span class="sy0">=</span> z<span class="br0">&#91;</span>i<span class="br0">&#93;</span>.<span class="me1">match</span><span class="br0">&#40;</span><span class="co2">/\=\w+[?\s+|?&gt;]/g</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">if</span> <span class="br0">&#40;</span>y<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw2">var</span> j<span class="sy0">=</span><span class="nu0">0</span><span class="sy0">;</span>j<span class="sy0">&lt;</span>y.<span class="me1">length</span><span class="sy0">;</span>j<span class="sy0">++</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; z<span class="br0">&#91;</span>i<span class="br0">&#93;</span> <span class="sy0">=</span> z<span class="br0">&#91;</span>i<span class="br0">&#93;</span>.<span class="me1">replace</span><span class="br0">&#40;</span>y<span class="br0">&#91;</span>j<span class="br0">&#93;</span><span class="sy0">,</span>y<span class="br0">&#91;</span>j<span class="br0">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.<span class="me1">replace</span><span class="br0">&#40;</span><span class="co2">/\=(\w+)([?\s+|?&gt;])/g</span><span class="sy0">,</span><span class="st0">'=&quot;$1&quot;$2'</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;zz <span class="sy0">=</span> zz.<span class="me1">replace</span><span class="br0">&#40;</span>zSaved<span class="sy0">,</span>z<span class="br0">&#91;</span>i<span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp;<span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="kw1">return</span> zz<span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
<br />
<span class="co1">// Usage:</span><br />
$<span class="br0">&#40;</span><span class="st0">'#getInnerHtmlOfThis'</span><span class="br0">&#41;</span>.<span class="me1">ieInnerHTML</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://web-development-blog.co.uk/2010/05/16/dont-trust-the-output-of-innerhtml-or-jquery-html-in-internet-explorer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ajax requests cached by Internet Explorer</title>
		<link>http://web-development-blog.co.uk/2010/05/16/ajax-requests-cached-by-internet-explorer/</link>
		<comments>http://web-development-blog.co.uk/2010/05/16/ajax-requests-cached-by-internet-explorer/#comments</comments>
		<pubDate>Sun, 16 May 2010 13:30:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[AJAX]]></category>

		<guid isPermaLink="false">http://web-development-blog.co.uk/?p=335</guid>
		<description><![CDATA[God I hate IE&#8230;. and I really don&#8217;t often hate anything&#8230;.
IE tends to cache its responses to some AJAX requests, which if you ask me is very stupid for its default behaviour.
FireFox caching is disabled by default. As always much love to the Fox.
Anyway, if you&#8217;re using jQuery.ajax() remember to pass the cache: false argument [...]]]></description>
			<content:encoded><![CDATA[<p>God I hate IE&#8230;. and I really don&#8217;t often hate anything&#8230;.</p>
<p>IE tends to cache its responses to some AJAX requests, which if you ask me is very stupid for its default behaviour.</p>
<p>FireFox caching is disabled by default. As always much love to the Fox.</p>
<p>Anyway, if you&#8217;re using jQuery.ajax() remember to pass the cache: false argument otherwise you may get unexpected results.</p>
<div class="codecolorer-container javascript " style="overflow:auto;white-space:nowrap;width:100%"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br /></div></td><td><div class="javascript codecolorer" style="font-family:Monaco,Lucida Console,monospace">$.<span class="me1">ajax</span><span class="br0">&#40;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; async<span class="sy0">:</span><span class="kw2">true</span><span class="sy0">,</span><br />
&nbsp; &nbsp; cache<span class="sy0">:</span><span class="kw2">false</span><span class="sy0">,</span> &nbsp; <span class="co1">// &lt;-- Set this or you will feel pain!!</span><br />
&nbsp; &nbsp; type<span class="sy0">:</span><span class="st0">'post'</span><span class="sy0">,</span> <br />
&nbsp; &nbsp; data<span class="sy0">:</span> <span class="st0">'data[TreeRows]='</span> <span class="sy0">+</span> data<span class="sy0">,</span><br />
&nbsp; &nbsp; success<span class="sy0">:</span><span class="kw2">function</span><span class="br0">&#40;</span>request<span class="sy0">,</span> xhr<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">true</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><span class="sy0">,</span> <br />
&nbsp; &nbsp; url<span class="sy0">:</span><span class="st0">'/admin/pages/save_tree_state'</span><br />
&nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://web-development-blog.co.uk/2010/05/16/ajax-requests-cached-by-internet-explorer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Access dynamic jQuery elements that have been added to the DOM after page has loaded</title>
		<link>http://web-development-blog.co.uk/2009/11/08/access-dynamic-jquery-elements-added-to-dom-after-page-has-loaded/</link>
		<comments>http://web-development-blog.co.uk/2009/11/08/access-dynamic-jquery-elements-added-to-dom-after-page-has-loaded/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 10:43:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://web-development-blog.co.uk/?p=229</guid>
		<description><![CDATA[If you wanted to manipulate elements you&#8217;d added to a page with jQuery after the DOM had loaded, you used to have to specify event handlers when adding them.
jQuery v1.3 has a handy new &#8216;live&#8217; method. Which basically allows you to access all elements, whether present at page load or added dynamically afterward with jQuery.
jQuery [...]]]></description>
			<content:encoded><![CDATA[<p>If you wanted to manipulate elements you&#8217;d added to a page with jQuery after the DOM had loaded, you used to have to specify event handlers when adding them.</p>
<p>jQuery v1.3 has a handy new &#8216;live&#8217; method. Which basically allows you to access all elements, whether present at page load or added dynamically afterward with jQuery.</p>
<p><a href="http://docs.jquery.com/Events/live">jQuery documentation</a></p>
<p>Quick click event example:</p>
<div class="codecolorer-container javascript " style="overflow:auto;white-space:nowrap;width:100%"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br /></div></td><td><div class="javascript codecolorer" style="font-family:Monaco,Lucida Console,monospace">$<span class="br0">&#40;</span><span class="st0">&quot;a.deleteRow&quot;</span><span class="br0">&#41;</span>.<span class="me1">live</span><span class="br0">&#40;</span><span class="st0">&quot;click&quot;</span><span class="sy0">,</span> <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; # Code to manipulate all matching elements added before or after the DOM has loaded.<br />
<span class="br0">&#125;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://web-development-blog.co.uk/2009/11/08/access-dynamic-jquery-elements-added-to-dom-after-page-has-loaded/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Submit form with jQuery gotcha</title>
		<link>http://web-development-blog.co.uk/2009/10/29/submit-form-with-jquery-gotcha/</link>
		<comments>http://web-development-blog.co.uk/2009/10/29/submit-form-with-jquery-gotcha/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 15:40:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://web-development-blog.co.uk/?p=211</guid>
		<description><![CDATA[It seems that you can&#8217;t submit a form with jQuery using:
1$&#40;'form#myform'&#41;.submit&#40;&#41;;
If you have an input in the form with the name attribute set to submit. So this doesn&#8217;t work:
1&#60;input type=&#34;submit&#34; name=&#34;submit&#34; value=&#34;Press to continue&#34; /&#62;
Change the name attribute to something else other than submit and it works fine ;]
]]></description>
			<content:encoded><![CDATA[<p>It seems that you can&#8217;t submit a form with jQuery using:</p>
<div class="codecolorer-container css " style="overflow:auto;white-space:nowrap;width:100%"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br /></div></td><td><div class="css codecolorer" style="font-family:Monaco,Lucida Console,monospace">$<span class="br0">&#40;</span><span class="st0">'form#myform'</span><span class="br0">&#41;</span>.submit<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></td></tr></tbody></table></div>
<p>If you have an input in the form with the name attribute set to submit. So this doesn&#8217;t work:</p>
<div class="codecolorer-container css " style="overflow:auto;white-space:nowrap;width:100%"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br /></div></td><td><div class="css codecolorer" style="font-family:Monaco,Lucida Console,monospace">&lt;input type<span class="sy0">=</span><span class="st0">&quot;submit&quot;</span> name<span class="sy0">=</span><span class="st0">&quot;submit&quot;</span> value<span class="sy0">=</span><span class="st0">&quot;Press to continue&quot;</span> /<span class="sy0">&gt;</span></div></td></tr></tbody></table></div>
<p>Change the name attribute to something else other than submit and it works fine ;]</p>
]]></content:encoded>
			<wfw:commentRss>http://web-development-blog.co.uk/2009/10/29/submit-form-with-jquery-gotcha/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CakePHP plugin view overriding</title>
		<link>http://web-development-blog.co.uk/2009/08/27/cakephp-plugin-view-overriding/</link>
		<comments>http://web-development-blog.co.uk/2009/08/27/cakephp-plugin-view-overriding/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 16:47:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://web-development-blog.co.uk/?p=167</guid>
		<description><![CDATA[Woo hoo! It&#8217;s possible to override CakePHP plugin views just like in Rails using the Engines plugin. Documentation on how to do it is a bit thin on the ground though.
Say you created a CakePHP plugin called &#8216;cms&#8217; and you had a plugin controller called &#8216;pages&#8217; inside the cms plugin. Just place the views you [...]]]></description>
			<content:encoded><![CDATA[<p>Woo hoo! It&#8217;s possible to override CakePHP plugin views just like in Rails using the Engines plugin. Documentation on how to do it is a bit thin on the ground though.</p>
<p>Say you created a CakePHP plugin called &#8216;cms&#8217; and you had a plugin controller called &#8216;pages&#8217; inside the cms plugin. Just place the views you want to override in:</p>
<div class="codecolorer-container bash " style="overflow:auto;white-space:nowrap;width:100%"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br /></div></td><td><div class="bash codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="sy0">/</span>app<span class="sy0">/</span>views<span class="sy0">/</span>plugins<span class="sy0">/</span>cms<span class="sy0">/</span>pages<span class="sy0">/</span></div></td></tr></tbody></table></div>
<p>I&#8217;ll post again when I&#8217;ve had a play at extending plugin controllers and models from the main app folder.</p>
]]></content:encoded>
			<wfw:commentRss>http://web-development-blog.co.uk/2009/08/27/cakephp-plugin-view-overriding/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Reset PHP array key values</title>
		<link>http://web-development-blog.co.uk/2009/05/16/reset-php-array-key-values/</link>
		<comments>http://web-development-blog.co.uk/2009/05/16/reset-php-array-key-values/#comments</comments>
		<pubDate>Sat, 16 May 2009 11:17:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Eco friendly / green computing]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://web-development-blog.co.uk/?p=161</guid>
		<description><![CDATA[To reset the key values in  a PHP array you can do this:
1234567891011121314151617181920212223$things = array&#40;'a','b','c','d'&#41;;
unset&#40;$things&#91;0&#93;&#41;;
print_r&#40;$things&#41;; 

#outputs
#Array
#(
# &#160; &#160;[1] =&#62; b
# &#160; &#160;[2] =&#62; c
# &#160; &#160;[3] =&#62; d
#)

# Actually do the reset.
$things = array_values&#40;$things&#41;;

print_r&#40;$things&#41;;
#outputs 
#Array
#(
# &#160; &#160;[0] =&#62; b
# &#160; &#160;[1] =&#62; c
# &#160; &#160;[2] =&#62; d
#)
]]></description>
			<content:encoded><![CDATA[<p>To reset the key values in  a PHP array you can do this:</p>
<div class="codecolorer-container php " style="overflow:auto;white-space:nowrap;width:100%;height:300px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br /></div></td><td><div class="php codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="re0">$things</span> <span class="sy0">=</span> <span class="kw3">array</span><span class="br0">&#40;</span><span class="st_h">'a'</span><span class="sy0">,</span><span class="st_h">'b'</span><span class="sy0">,</span><span class="st_h">'c'</span><span class="sy0">,</span><span class="st_h">'d'</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="kw3">unset</span><span class="br0">&#40;</span><span class="re0">$things</span><span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="kw3">print_r</span><span class="br0">&#40;</span><span class="re0">$things</span><span class="br0">&#41;</span><span class="sy0">;</span> <br />
<br />
<span class="co2">#outputs</span><br />
<span class="co2">#Array</span><br />
<span class="co2">#(</span><br />
<span class="co2"># &nbsp; &nbsp;[1] =&gt; b</span><br />
<span class="co2"># &nbsp; &nbsp;[2] =&gt; c</span><br />
<span class="co2"># &nbsp; &nbsp;[3] =&gt; d</span><br />
<span class="co2">#)</span><br />
<br />
<span class="co2"># Actually do the reset.</span><br />
<span class="re0">$things</span> <span class="sy0">=</span> <span class="kw3">array_values</span><span class="br0">&#40;</span><span class="re0">$things</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<br />
<span class="kw3">print_r</span><span class="br0">&#40;</span><span class="re0">$things</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="co2">#outputs </span><br />
<span class="co2">#Array</span><br />
<span class="co2">#(</span><br />
<span class="co2"># &nbsp; &nbsp;[0] =&gt; b</span><br />
<span class="co2"># &nbsp; &nbsp;[1] =&gt; c</span><br />
<span class="co2"># &nbsp; &nbsp;[2] =&gt; d</span><br />
<span class="co2">#)</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://web-development-blog.co.uk/2009/05/16/reset-php-array-key-values/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SWFUpload returns HTTP 401 error after Apache authentication / password protected directory</title>
		<link>http://web-development-blog.co.uk/2009/04/30/swfupload-returns-http-401-error-after-apache-authentication-password-protected-directory/</link>
		<comments>http://web-development-blog.co.uk/2009/04/30/swfupload-returns-http-401-error-after-apache-authentication-password-protected-directory/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 16:38:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://web-development-blog.co.uk/?p=152</guid>
		<description><![CDATA[Uploaded my first site today that uses SWF Upload to handle large file uploads. The admin area of that site had basic Apache HTTP authentication via a .htaccess file.
SWF Upload failed with a 401 error after testing. It seems you can&#8217;t use this style of authentication with the current version of SWF Upload. Something to [...]]]></description>
			<content:encoded><![CDATA[<p>Uploaded my first site today that uses SWF Upload to handle large file uploads. The admin area of that site had basic Apache HTTP authentication via a .htaccess file.</p>
<p>SWF Upload failed with a 401 error after testing. It seems you can&#8217;t use this style of authentication with the current version of SWF Upload. Something to do with a bug/short-fall in Flash.</p>
<p>Anyways, good news as SWF Upload will handle PHP sessions (not looked into RoR sessions yet) therefore you can build your own PHP user system. You need to pass the PHP session variables through, you can use code along the lines of this to pass them:</p>
<div class="codecolorer-container javascript " style="overflow:auto;white-space:nowrap;width:100%"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="javascript codecolorer" style="font-family:Monaco,Lucida Console,monospace"># The post_params variables being the ones of interest.<br />
<span class="me1">upload_url</span> <span class="sy0">:</span> <span class="st0">&quot;/media-uploads/upload/&quot;</span><span class="sy0">,</span> &nbsp;&nbsp; &nbsp; <br />
post_params<span class="sy0">:</span> <span class="br0">&#123;</span><br />
&nbsp; <span class="st0">&quot;PHPSESSID&quot;</span> <span class="sy0">:</span> <span class="st0">&quot;&lt;?php echo session_id(); ?&gt;&quot;</span><span class="sy0">,</span><br />
&nbsp; <span class="st0">&quot;PHPSESSNAME&quot;</span><span class="sy0">:</span> <span class="sy0">&lt;?</span>php echo session_name<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="sy0">?&gt;</span><span class="st0">&quot;<br />
},<br />
flash_url : &quot;</span><span class="sy0">/</span>flash<span class="sy0">/</span>swfupload.<span class="me1">swf</span><span class="st0">&quot;,</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://web-development-blog.co.uk/2009/04/30/swfupload-returns-http-401-error-after-apache-authentication-password-protected-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

