<?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>TBNL &#187; javascript</title>
	<atom:link href="http://www.tibobeijen.nl/blog/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tibobeijen.nl</link>
	<description>...another view on the web and how it's built</description>
	<lastBuildDate>Wed, 06 Jul 2011 19:28:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Usability: Autofocus and not breaking the backspace-button</title>
		<link>http://www.tibobeijen.nl/blog/2011/03/14/usability-autofocus-and-not-breaking-the-backspace-button/</link>
		<comments>http://www.tibobeijen.nl/blog/2011/03/14/usability-autofocus-and-not-breaking-the-backspace-button/#comments</comments>
		<pubDate>Mon, 14 Mar 2011 11:32:39 +0000</pubDate>
		<dc:creator>Tibo Beijen</dc:creator>
				<category><![CDATA[articles]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jquery plugin]]></category>
		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://www.tibobeijen.nl/?p=672</guid>
		<description><![CDATA[A while ago during a project we were asked to implement autofocus on the generic search field that every page in the application has. At a first glance a pretty straightforward task, from a technical perspective that is. Not from a user perspective, as indicated by a colleague mentioning his dislike of such autofocus fields [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago during a project we were asked to implement autofocus on the generic search field that every page in the application has. At a first glance a pretty straightforward task, from a technical perspective that is. Not from a user perspective, as indicated by a colleague mentioning his dislike of such autofocus fields &#8220;because they prevent backspace going to the previous page&#8221;. In this post I will outline some usability considerations and conclude with a jQuery plugin that will take away some of the possible hindrance of autofocusing a field.</p>
<h3>Usability considerations</h3>
<p>There are some things to consider to determine if such automatic focusing of a search field is actually helpful to the user navigating to the page. Who is <em>the</em> user?</p>
<p>As I was discussing this case with <a href="http://www.architecto.nl">an interaction designer friend</a> (dutch) of mine, he brought up the idea of mimicking the browser&#8217;s backspace behaviour, and discussing it further we concluded that this might be useful in some cases but is definitely not a &#8216;one size fits all&#8217; solution.</p>
<h4>Different goals</h4>
<p>Different users will probably have different goals when navigating to a page. On the google page or a login screen the majority of the users&#8217; goal is to type something in the first input field. On a lot of other pages this won&#8217;t be so obvious. Question then is: Will focusing a search field, if not help, instead <em>hinder</em> the user? For example: A user might have navigated to a page by accident. In that case not being able to go to the previous page by pressing &#8216;backspace&#8217; might indeed hinder the user.</p>
<h4>Different expectations</h4>
<p>Not every user navigates to the previous page by using &#8216;backspace&#8217;, some might not even be aware of that possibility. Not every user expects text entered to automatically appear in an input field. Some users might have enabled the option to directly find text in a page when typing text and find this functionality suddenly broken.</p>
<p><a href="http://diveintohtml5.org/detect.html#input-autofocus">Dive into HTML5</a> has some other nice examples of how autofocus might <em>not</em> be helpful.</p>
<h3>What size fits all?</h3>
<p>As mentioned before, there is no &#8216;one size fits all&#8217; solution. Questions that need to be asked include:</p>
<ul>
<li>How many users might be helped by adding autofocus to a common search field?</li>
<li>How many users might instead be hindered by autofocus?</li>
<li>Are there pages where autofocus on more specific fields (like the main form) is needed which will break consistency throughout the site?</li>
</ul>
<p>This means studying your site, the target audience, their goals and expectations and based on that finding a balance.</p>
<h3>Restoring the backspace: jQuery autofocusBackspace plugin</h3>
<p>If the conclusion of aforementioned considerations is that autofocus indeed <em>is</em> helpful, there is more than one way to achieve this: The first is using the HTML5 autofocus attribute. Another is using javascript to focus the field.</p>
<p>As not all browsers support the autofocus attribute yet, and we wanted to preserve the browser&#8217;s backspace functionality, I created a jQuery plugin that does just that:</p>
<ul>
<li>It focuses the first matching element
<li>It responds to &#8216;backspace&#8217; by navigating to the previous page.
<ul>
<li>Only until a user has entered text
<li>Only until the element loses focus</ul>
</ul>
<p>Refer to GitHub for the <a href="https://github.com/TBeijen/jQuery-plugin-autofocusBackspace">jQuery plugin autospaceBackspace</a>. </p>
<p>Feel free to report problems or ideas for improvement.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tibobeijen.nl/blog/2011/03/14/usability-autofocus-and-not-breaking-the-backspace-button/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fronteers 2009</title>
		<link>http://www.tibobeijen.nl/blog/2009/11/07/fronteers-2009/</link>
		<comments>http://www.tibobeijen.nl/blog/2009/11/07/fronteers-2009/#comments</comments>
		<pubDate>Sat, 07 Nov 2009 18:46:22 +0000</pubDate>
		<dc:creator>Tibo Beijen</dc:creator>
				<category><![CDATA[report]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[fronteers]]></category>
		<category><![CDATA[fronteers09]]></category>
		<category><![CDATA[frontend]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[webdesign]]></category>
		<category><![CDATA[yql]]></category>

		<guid isPermaLink="false">http://www.tibobeijen.nl/?p=555</guid>
		<description><![CDATA[About five months after having enjoyed server-side talks at DPC09 it was now time for front-end matters: Fronteers 2009. There&#8217;s no exaggeration in the description on the fronteers site: A stellar line up of speakers who are at the front of what&#8217;s happening in web-development. Generally speaking I really liked most of the talks and [...]]]></description>
			<content:encoded><![CDATA[<p>About five months after having enjoyed server-side talks at <a href="http://www.tibobeijen.nl/blog/2009/06/13/dpc09-down-dpc10-to-go/">DPC09</a> it was now time for front-end matters: Fronteers 2009. There&#8217;s no exaggeration in the description on the fronteers site: A <a href="http://fronteers.nl/congres/2009/speakers">stellar line up</a> of speakers who are at the front of what&#8217;s happening in web-development. Generally speaking I really liked most of the talks and some of them pointed me to some interesting new techniques and ideas.</p>
<p>Slides of the presentation (if online) are listed at the <a href="http://fronteers.nl/blog/2009/11/presentations-fronteers-2009">Fronteers site</a> and at the end of this post (same content, read along). I&#8217;ll briefly recap some of the (for me that is) most interesting parts.<br />
<span id="more-555"></span></p>
<h3>Thursday</h3>
<p>After a pre-conference meeting tuesday at Mirabeau (Where Chris Heilmann and Peter Paul Koch hinted at what was to come) Thursday started with two talks concentrating on the mobile web. Summarized: Webkit is not webkit (and webkit is just one of the mobile browsers) and mobile devices are more different from each-other than desktop PC&#8217;s. So, developing for the mobile web (and not just the iPhone) is challenging. </p>
<p>Next on was the presentation with the most hilarious title of all (and arguably content also) by Chris Heilman: <a href="http://www.wait-till-i.com/2009/11/05/of-hamsters-feature-creatures-and-missed-opportunities-my-talk-at-fronteers-2009/">Of Hamsters, Feature Creatures and Missed Opportunities</a>. Some highlights: Be passionate about what you do as a developer or leave that aspect for someone who <em>is</em>. Don&#8217;t reinvent the wheel just because you like to apply a (your favorite) technique. The web is information, not sites. The feature creature (just check the slides) and <a href="http://developer.yahoo.com/yql/console/">YQL</a>, which basically is querying the web and looks really great (kinda missed out on that one having done a lot of back-end development lately).</p>
<p>After the lunch-break Stephen Hay covered three drafts that exist for CSS layouts that will take away the limitations that exist today: CSS3-Grid (Microsoft), CSS3-Flexbox (Mozilla) and CSS3-Layout (W3C). Very interesting as it makes very clear that, although a vast improvement over tables, today&#8217;s CSS capabilities with respect to layout (and thereby the way we work) are far from perfect.<br />
Following Stephen, John Resig went in-depth on javascript testing techniques covering unit testing as well as functional testing. Furthermore an interesting testing concept that can be used for testing JS frameworks was introduced: <a href="http://testswarm.com/">TestSwarm</a>. Steve Souders, fully aware of being the last barrier between the crowd and the after-party, concluded the day with some interesting techniques that can help speed up websites.</p>
<h3>Friday</h3>
<p>Douglas Crockford kicked of day 2 with a presentation about javascript security. He explained <a href="http://en.wikipedia.org/wiki/Object-capability_model">Object Capapability Design</a>, a security model in which objects can only access objects they have a reference too. I liked the part about using &#8216;facet objects&#8217; to control whether or not references are maintained or broken. After that Pete LePage showed some HTML5 stuff that&#8217;s found it&#8217;s way into IE8. The presentation had a (not the only one) funny moment where in Expression Web&#8217;s IE6 emulation it showed the fronteers website with the &#8216;your (IE6) browser is obsolete&#8217; warning. Jonathan Snook then extensively covered the topic of getting fonts on the web. It was very interesting that he addressed the licensing issues involved with using tools like sIFR. Something I think is often overlooked.</p>
<p>After the lunch Robbert Broersma lifted the hood (just slightly) of the engine powering the Xopus editor. He showed some tips with regard to improving and maintaining performance, most notably <a href="http://www.google.nl/search?q=leak+free+closures">Google for &#8216;leak free closures&#8217;</a>. Thomas Fuchs took over and explained some of the animation scripting going on in <a href="http://scripty2.com/">scripty2</a> and showcased his lightweight animation library <a href="http://github.com/madrobby/emile">emile.js</a>.</p>
<p>Next presentation was by Nicolle Sullivan and the title &#8216;Object Oriented CSS&#8217; made me quite curious. Rightly so cause I really enjoyed this presentation. OOP concepts like code reuse, encapsulation, singletons and inheritance were put into the perspective of organizing CSS. Quite a different approach really but it addresses problems I think a lot off css-coders can relate to. I found it interesting to realize that OOP thinking, which for me is day-to-day practice when working with PHP, somehow hadn&#8217;t made it to my CSS approach. At least not to the extent as shown in this presentation.</p>
<p>The day concluded with Dion Almaer and Ben Galbraith talking about &#8216;The Future of Web Applications&#8217;. Very entertaining presentation covering new technologies like <a href="http://code.google.com/closure/">Google Closure Tools</a> (Quoting: &#8216;If you want to write code that looks like java then it&#8217;s a great tool for you&#8217;), canvas, web workers and webGL.</p>
<p>Conclusion: Very nice conference with indeed a stellar line-up. As always the hallway sessions are not to be underestimated as I usually (unless I&#8217;m tired or need to get things done) find it interesting to talk to other people and pick up some new ideas or approaches. To conclude with the closing presentation&#8217;s very fitting last commandments (yes, I wrote those down):</p>
<ul>
<li>Thou shalt make thine interfaces responsive</li>
<li>Thou shalt keep the data of thy users holy</li>
</ul>
<ul>
<li><a href="http://search.twitter.com/search?q=&#038;ands=&#038;phrase=&#038;ors=&#038;nots=&#038;tag=fronteers09&#038;lang=all&#038;from=&#038;to=&#038;ref=&#038;near=&#038;within=15&#038;units=mi&#038;since=&#038;until=&#038;rpp=15">Twitter: #fronteers09</a></li>
<li><a href="http://www.flickr.com/search/?q=fronteers09&#038;s=int">Flickr: fronteers09</a></li>
</ul>
<h3>Presentations</h3>
<p>Just to show that YQL literally <em>is</em> &#8216;querying the web&#8217;: The YQL below extracts from the <a href="http://fronteers.nl/blog/2009/11/presentations-fronteers-2009">Fronteers 2009 presentations</a> page those elements in the list that have a link. And&#8230; it always returns valid xml which makes it ideal for parsing the <del datetime="2009-11-08T19:21:45+00:00">HTML</del> cruft generated by some applications.</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> html 
<span style="color: #993333; font-weight: bold;">WHERE</span> url<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://fronteers.nl/blog/2009/11/presentations-fronteers-2009&quot;</span> 
<span style="color: #993333; font-weight: bold;">AND</span> xpath<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;//ol/li/p/a/ancestor::li&quot;</span></pre></div></div>

<ul class="paragraphs">
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.tibobeijen.nl/blog/2009/11/07/fronteers-2009/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Taming the Javascript event scope: Closures</title>
		<link>http://www.tibobeijen.nl/blog/2009/07/27/taming-the-javascript-event-scope-closures/</link>
		<comments>http://www.tibobeijen.nl/blog/2009/07/27/taming-the-javascript-event-scope-closures/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 13:52:44 +0000</pubDate>
		<dc:creator>Tibo Beijen</dc:creator>
				<category><![CDATA[miscellaneous]]></category>
		<category><![CDATA[closure]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.tibobeijen.nl/?p=459</guid>
		<description><![CDATA[When doing client-side developing there are times that jQuery&#8217;s get-this-do-that nature doesn&#8217;t provide all that is needed. For more complex applications I usually find myself creating javascript objects that &#8216;control&#8217; a specific part of the page&#8217;s interaction. In the objects the application&#8217;s state is tracked, references to other objects (could be relevant DOM nodes) are [...]]]></description>
			<content:encoded><![CDATA[<p>When doing client-side developing there are times that jQuery&#8217;s get-this-do-that nature doesn&#8217;t provide all that is needed. For more complex applications I usually find myself creating javascript objects that &#8216;control&#8217; a specific part of the page&#8217;s interaction. In the objects the application&#8217;s state is tracked, references to other objects (could be relevant DOM nodes) are stored and event handlers are set.</p>
<p>One of the problems typically encountered when dealing with javascript event handlers is that they have their own take on the &#8216;this&#8217; keyword. Closures to the rescue.<br />
<span id="more-459"></span><br />
A simple (and rather useless) example:</p>
<p>html:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;javascript&quot;</span> type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#scope div'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>idx<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003366; font-weight: bold;">var</span> btnController <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> controllerExample<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span>idx<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;scope&quot;</span><span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>div<span style="color: #339933;">&gt;</span>
        <span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;&lt;/</span>p<span style="color: #339933;">&gt;</span>
        <span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;button&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;btn 1&quot;</span> <span style="color: #339933;">/&gt;</span>
    <span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>div<span style="color: #339933;">&gt;</span>
        <span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;&lt;/</span>p<span style="color: #339933;">&gt;</span>
        <span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;button&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;btn 2&quot;</span> <span style="color: #339933;">/&gt;</span>
    <span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></div></div>

<p>javascript:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> controllerExample<span style="color: #009900;">&#40;</span>node<span style="color: #339933;">,</span>idx<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">node</span> <span style="color: #339933;">=</span> node<span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">idx</span> <span style="color: #339933;">=</span> idx<span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">clickCount</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">setEventHandlers</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
controllerExample.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">setEventHandlers</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
      $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">node</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">handleClick</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
controllerExample.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">handleClick</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">clickCount</span><span style="color: #339933;">++;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">node</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'p'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span>
        <span style="color: #3366CC;">'Button is clicked '</span><span style="color: #339933;">+</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">clickCount</span><span style="color: #339933;">+</span><span style="color: #3366CC;">' time(s)'</span>
    <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h3>&#8216;this&#8217; is wrong</h3>
<p>Now that doesn&#8217;t work&#8230; When the click event fires the handleClick() function is executed but the scope is not the controllerExample instance. On execution the &#8216;this&#8217; keyword points to the input element. So we see &#8216;Button is clicked NaN time(s)&#8217;.</p>
<p>The Prototype javascript library has a solution for this by extending the basic function object type with the bind() and bindAsEventListener() methods. Very nice but to include Prototype just for that&#8230; bad idea. It&#8217;s perfectly possible to separately implement a similar bind() function method but that still creates an additional (besides jQuery) dependency for that method. Let&#8217;s keep the mess to a minimum and keep it &#8216;in&#8217; the controllerExample object.</p>
<h3>Closure</h3>
<p>Prototype&#8217;s bind() function uses what is called a closure: A function defined within a function. The benefit is that the inner function, which in the following example is returned by the outer function, has access to the outer functions local variables <em>after</em> the outer function has returned.</p>
<p>Properly &#8216;binding&#8217; the handleClick event handler now looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">controllerExample.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">setEventHandlers</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><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> _scope <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> getHandleClick <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// window</span>
        console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span>_scope<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// controllerExample</span>
        <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">return</span> _scope.<span style="color: #660066;">handleClick</span>.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span>_scope<span style="color: #339933;">,</span>event<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">node</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span>getHandleClick<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>getHandleClick() returns a function that, when executing, still has access to _scope which <em>is</em> the correct scope. The console.log lines are there to illustrate that inside the inner function we can&#8217;t use &#8216;this&#8217;. The getHandleClick() function has no object scope so it&#8217;s &#8216;this&#8217; is the window scope. But the object scope can be passed into by copying &#8216;this&#8217; to a new variable _scope and use that inside the closure.</p>
<p>More information about closures: <a href="http://www.javascriptkit.com/javatutors/closures.shtml">Javascript closures 101</a> (basic) and <a href="http://www.jibbering.com/faq/faq_notes/closures.html">This article on jibbering.com</a> (advanced).</p>
<h3>routeEvent</h3>
<p>Now the above is fine if there&#8217;s just one or two event handlers to be added but is not really &#8216;generic&#8217;. So let&#8217;s create a more generic &#8216;routeEvent&#8217; method that creates a closure for the eventHandler that is passed in:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">controllerExample.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">setEventHandlers</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">node</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span>
        <span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">routeEvent</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">handleClick</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #006600; font-style: italic;">// ...</span>
controllerExample.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">routeEvent</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>eventHandler<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> _scope <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">return</span> eventHandler.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span>_scope<span style="color: #339933;">,</span>event<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Now the handleClick() method will be called with the correct &#8216;this&#8217; and is also provided with the jQuery event object.</p>
<p>A demo putting it al together can be seen <a href="/static/event_scope_closure/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tibobeijen.nl/blog/2009/07/27/taming-the-javascript-event-scope-closures/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Annoying banners: A plea for quality</title>
		<link>http://www.tibobeijen.nl/blog/2009/04/27/annoying-banners-a-plea-for-quality/</link>
		<comments>http://www.tibobeijen.nl/blog/2009/04/27/annoying-banners-a-plea-for-quality/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 20:51:10 +0000</pubDate>
		<dc:creator>Tibo Beijen</dc:creator>
				<category><![CDATA[miscellaneous]]></category>
		<category><![CDATA[advertisement]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://www.tibobeijen.nl/?p=330</guid>
		<description><![CDATA[Banners play an essential role in many site&#8217;s business models so they are an inevitable price paid for all the free content that is available on the internet. To get a user&#8217;s attention a lot of practices are employed like animation, placement or sound (horrible). Today I stumbled on a T-mobile advert on the site [...]]]></description>
			<content:encoded><![CDATA[<p>Banners play an essential role in many site&#8217;s business models so they are an inevitable price paid for all the free content that is available on the internet. To get a user&#8217;s attention a lot of practices are employed like animation, placement or sound (horrible). Today I stumbled on a T-mobile advert on the site <a href="http://www.nu.nl/internet/1955631/worm-conficker-wordt-geleidelijk-actief.html">nu.nl</a> that indeed attracts a lot of attention but does so in a questionable way: It makes using the visited site almost impossible. (Not a new phenomenon and it&#8217;s certainly not the first time I encounter such a banner). </p>
<p>The T-mobile banner is positioned at the bottom of the viewport and is kept in place by javascript or actionscript. This means that during scrolling the banner shakes because the script reacts to the scroll event. No awards won but not a real problem either. But what <em>is</em> bad is the fact that in the orange area (note the little pun there) no link can be clicked. Something I didn&#8217;t notice at first resulting in rapid agitated clicking. See screenshot below:</p>
<div id="attachment_335" class="wp-caption aligncenter" style="width: 510px"><img src="http://www.tibobeijen.nl/blog/wp-content/uploads/2009/04/tmobile_add_scaled_text.jpg" alt="T-Mobile banner on nu.nl" title="tmobile_add_scaled_text" width="500" height="317" class="size-full wp-image-335" /><p class="wp-caption-text">T-Mobile banner on nu.nl</p></div>
<p>As a &#8216;normal&#8217; visitor that is just annoying but as a web-professional it irritates me to a great extend that there seems to be no technical need for this misbehaviour whatsoever. So what goes wrong? On a first glance there seem to be four roles involved:</p>
<ul>
<li>Nu.nl: They need adds but it seems unlikely they want banners to block parts of their site and thereby cause user frustration.</li>
<li>The banner merchant. Doubleclick, adclick or whatever their names are. I&#8217;m not really into the advertisement business but I wouldn&#8217;t be surprised if different advertisement programs exist that site publishers can use: flashy or not, type of products promoted, sound or not, full page mayhem or not. That sort of differentiations. Normally adds on nu.nl aren&#8217;t this annoying so something might have gone wrong there.</li>
<li>The developer or company developing the banner. Perhaps there&#8217;s a tight deadline. Perhaps technical knowledge is lacking. Maybe they just don&#8217;t care&#8230;</li>
<li>The advertiser, in this case T-Mobile. Bottom line is: they want to get visitors to their site. But perhaps reputation might be a consideration. I think in most cases that the people reviewing a banner proposol don&#8217;t have the knowledge to determine that a banner has these unwanted technical side-effects. Or the prototype presented doesn&#8217;t show the problems.</li>
</ul>
<p>So somewhere in the process things go wrong, be it a lack of knowledge or a lack of interest for the end-user. Sadly the result is a lack of quality having bad usability as a consequence.</p>
<p>To conclude this criticism in a more positive and constructive fashion I&#8217;ve made a quick css proof of concept showing that it&#8217;s perfectly possible to achieve the layout while preserving click access to the underlying site. </p>
<p><a href="/static/less_annoying_banner/">Bottom aligned banner proof of concept</a></p>
<p>It&#8217;s positioning is now done by using css position:absolute but could just as well have been javascript. The demo took about 15 minutes to make while watching tv. I haven&#8217;t tested it on IE6 so expect about 2 hours needed for that but even then development time seems reasonable. The advertisment html part is displayed below.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div id=&quot;banner&quot; style=&quot;background-color:purple;position:fixed;bottom:0;width:100%;height:80px;&quot;&gt;
	&lt;div id=&quot;bannerCenter&quot; style=&quot;width:760px;height:80px;position:relative;margin:0 auto;background-color:red;&quot;&gt;
		&lt;div id=&quot;phone&quot; style=&quot;position:absolute;width:100px;height:160px;left:660px;top:-100px;background-color:#666;z-index&quot;100;&quot;&gt;
		&lt;/div&gt;
	&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;</pre></div></div>

<p>Of course the real world is more complicated than can be described in a short article but it&#8217;s obvious that the examined banner is sub-par. In my opinion it would be wise, or at least nice, to take the user a bit more seriously.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tibobeijen.nl/blog/2009/04/27/annoying-banners-a-plea-for-quality/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Jumping in and out of jQuery land</title>
		<link>http://www.tibobeijen.nl/blog/2009/04/02/jumping-in-and-out-of-jquery-land/</link>
		<comments>http://www.tibobeijen.nl/blog/2009/04/02/jumping-in-and-out-of-jquery-land/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 21:34:59 +0000</pubDate>
		<dc:creator>Tibo Beijen</dc:creator>
				<category><![CDATA[miscellaneous]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.tibobeijen.nl/?p=243</guid>
		<description><![CDATA[Recently I started using jQuery in some projects. In past projects I have mainly been using Prototype and the fact that jQuery also has a $() function made me feel at home right away. That same fact put me a bit off-guard as both functions are in fact quite different: Prototype extends the selected HTML [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I started using jQuery in some projects. In past projects I have mainly been using Prototype and the fact that jQuery also has a $() function made me feel at home right away. That same fact put me a bit off-guard as both functions are in fact quite different:</p>
<ul>
<li>Prototype extends the selected HTML node with added functionality and returns it. Argument should be a HTML node or element id.</li>
<li>jQuery selects the HTML node (or nodes) and stores the selection in a jQuery object, which then is returned. Argument should be a css-like selector.</li>
</ul>
<p>So, as opposed to Prototype, jQuery&#8217;s $() method can select a single element as well as a collection of elements. The existence of <a href="http://www.prototypejs.org/api/utility#method-$$">Prototype&#8217;s $$() function</a> also kind of suggests that Prototype&#8217;s $() doesn&#8217;t do that. And&#8230; when passing just an id to jQuery&#8217;s $() (e.g. $(&#8216;myDiv&#8217;)) it is discovered soon enough that nothing is selected but air.</p>
<p>By using jQuery&#8217;s $() functionwe&#8217;re leaving the DOM-zone and enter jQuery land. Although jQuery can do a lot, situations might occur where one needs to get the &#8216;real&#8217; DOM elements. For instance, to pass them as argument to components that don&#8217;t talk jQuery. Luckily it&#8217;s just as easy to go back, by using the get() accessor.</p>
<p>Some simplified HTML code example boxes:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;codeBox&quot;</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>copy to clipboard<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">code</span>&gt;</span>Some code<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">code</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;codeBox&quot;</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>copy to clipboard<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">code</span>&gt;</span>More code<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">code</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></div></div>

<p>Accompanied by the following javascript:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    initCodeBox<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> initCodeBox<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.codeBox a'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><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> htmlNode <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">siblings</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'code'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">get</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>htmlNode<span style="color: #009900;">&#41;</span> copyContentsToClipboard<span style="color: #009900;">&#40;</span>htmlNode<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> copyContentsToClipboard<span style="color: #009900;">&#40;</span>htmlNode<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
        <span style="color: #006600; font-style: italic;">// js selecting the text contents of a DOM node, simplified to: </span>
    <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>htmlNode.<span style="color: #660066;">innerHTML</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>It&#8217;s clear that, as long as existing code doesn&#8217;t conflict with the $() function, it&#8217;s very easy to start using jQuery in existing projects.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tibobeijen.nl/blog/2009/04/02/jumping-in-and-out-of-jquery-land/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fronteers: Meeting march 10th</title>
		<link>http://www.tibobeijen.nl/blog/2009/03/15/fronteers-meeting-march-10th/</link>
		<comments>http://www.tibobeijen.nl/blog/2009/03/15/fronteers-meeting-march-10th/#comments</comments>
		<pubDate>Sun, 15 Mar 2009 10:04:20 +0000</pubDate>
		<dc:creator>Tibo Beijen</dc:creator>
				<category><![CDATA[report]]></category>
		<category><![CDATA[fronteers]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[suave]]></category>

		<guid isPermaLink="false">http://www.tibobeijen.nl/?p=212</guid>
		<description><![CDATA[At the PHPgg Frontend Special I first heard of Fronteers, an association of dutch front-end developers. Past tuesday they had a meeting at Media College in Amsterdam. As meetings are open for non(yet)-members it was a nice opportunity to get to know more about Fronteers. Two topics were scheduled: jQuery and SUAVE. jQuery Until now [...]]]></description>
			<content:encoded><![CDATA[<p>At the PHPgg Frontend Special I first heard of <a href="http://fronteers.nl/">Fronteers</a>, an association of dutch front-end developers. Past tuesday they had a meeting at Media College in Amsterdam. As meetings are open for non(yet)-members it was a nice opportunity to get to know more about Fronteers. Two topics were scheduled: jQuery and SUAVE.</p>
<h3>jQuery</h3>
<p>Until now I have mainly used the <a href="http://www.prototypejs.org/">Prototype</a> framework for Javascript projects. As the prototype library, escpecially when bundled with scriptaculous, is quite &#8216;big&#8217; I was interested in hearing some more about the &#8216;lean and mean&#8217; jQuery. In a short (but focussed) presentation of Edwin Martin some of the key aspects of jQuery were illustrated, most notably: <a href="http://docs.jquery.com/How_jQuery_Works#Chainability_.28The_Magic_of_jQuery.29">Method chaining</a>, <a href="http://docs.jquery.com/Plugins/Authoring">Plugins</a> (nice for keeping things organised) and <a href="http://docs.jquery.com/Events/live">Live events</a> (curious about performance). The jQuery motto &#8216;do more, write less&#8217; definitely stands although the functionality seems really focused on selecting, modifying and event-binding. I was missing Prototype&#8217;s class inheritance but as I read from the <a href="http://fronteers.nl/bijeenkomsten/2009/ma">Fronteers meeting report</a> that&#8217;s being worked in in the form of <a href="http://ejohn.org/blog/classy-query/">Classy Query</a>.</p>
<h3>Suave</h3>
<p>Next was a presentation, delivered by Marcel Beumer and Vincent Hillenbrink, about Suave, a stand-alone front-end. It&#8217;s a MVC based framework that allows front-end developers to communicate with a &#8216;back-end&#8217; that exists solely in the viewer&#8217;s browser. This way front-end developers can start creating templates and interaction and show working versions, without being dependent on properly functioning back-end software. In the background there is some XSLT databound templating going on thereby allowing for easy integration with back-end software once it&#8217;s ready. Suave isn&#8217;t finished yet so no online information is available. They aim at releasing a first version in about half a year, bundled with examples demonstrating it&#8217;s potential.</p>
<p>Of course there was plenty of time after the presentations to meet some people and chat with co-front-end-developers. Nice meeting!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tibobeijen.nl/blog/2009/03/15/fronteers-meeting-march-10th/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHPgg Frontend Special</title>
		<link>http://www.tibobeijen.nl/blog/2009/02/08/phpgg-frontend-special/</link>
		<comments>http://www.tibobeijen.nl/blog/2009/02/08/phpgg-frontend-special/#comments</comments>
		<pubDate>Sun, 08 Feb 2009 12:18:42 +0000</pubDate>
		<dc:creator>Tibo Beijen</dc:creator>
				<category><![CDATA[report]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[frontend]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[phpgg]]></category>

		<guid isPermaLink="false">http://www.yunademo.nl/preview/tibobeijen.nl/?p=93</guid>
		<description><![CDATA[Last saturday (2009 jan 24th) I attended the phpGG Frontend Special. phpGG stands for &#8216;PHP Gebruikersgroep&#8217; which translates to &#8216;PHP user group&#8217;. The meeting was held in a nice little theater in The Hague and was attended by what looked like about 50 people. The four main presentations scheduled: Microsoft &#8211; User Experience on the [...]]]></description>
			<content:encoded><![CDATA[<p>Last saturday (2009 jan 24th) I attended the <a href="http://phpgg.nl/frontendspecial2008">phpGG Frontend Special</a>. phpGG stands for &#8216;PHP Gebruikersgroep&#8217; which translates to &#8216;PHP user group&#8217;. The meeting was held in a nice little theater in The Hague and was attended by what looked like about 50 people. The four main presentations scheduled:</p>
<ul>
<li>Microsoft &#8211; User Experience on the web</li>
<li>Adobe &#8211; Flex/AIR </li>
<li>Javascript &#8211; 8 Reasons every PHP developer should love it </li>
<li>The frontend is your friend</li>
</ul>
<p><span id="more-93"></span></p>
<h3>Microsoft &#8211; User Experience on the web</h3>
<p>First speaker was Bram Veenhof, of whom I allready attended a presentation two months ago. Here the available time was more limited so less subjects were covered. He started with some coverage on the forthcoming Windows 7. Interesting features were addressed like: Dockable windows, swappable taskbar buttons and functionallity in preview windows. Next on was Silverlight and most specifically the video and deepzoom capabilities. </p>
<p>Two parts that were both interesting in their own right but not really connected to each other. In my opinion he had better addressed the XAML, Javascript integration some more. I think that is one of the strong points of Silverlight when it comes to smooth integration in a PHP driven application. </p>
<h3>Adobe &#8211; Flex/AIR</h3>
<p>Next on was Mihai Corlan, Adobe Platform Evangelist as he described himself. First part of his presentation was about Flex. For me it&#8217;s been a while since I&#8217;ve done Flash Development so I was curious about what&#8217;s happening on the Adobe front. Mihai summarized Flex as &#8216;Just another way to create a Flash app&#8217;. The Flex platform consists of:</p>
<ul>
<li>2 Languages: MXML and Actionscript 3</li>
<li>Compilers</li>
<li>Rich Component Library</li>
<li>Debuggers</li>
<li>Flex SDK (Open Source) </li>
<li>Flex Builder IDE (Eclipse so it runs nice alongside Zend Studio)</li>
</ul>
<p>As for the benefit of RIA&#8217;s he showed a little demo of a very graphical intuitive interface allowing users to report details about car damage. </p>
<p>After the topic was Adobe Air. Adobe Air allows web developers to develop beyond the browser. Api&#8217;s like file access, drag &#038; drop, allow for desktop apps to be developed using techniques familiar to Flash/Flex developers. Very interesting and probably much easier than starting to learn writing apps in Objective C or Java. </p>
<p>The link to PHP was addressed by the way Flex and Air applications communicate with online back-end software: REST, Web Services and RPC. Areas where PHP is at it&#8217;s best, especially with the arrival of Zend Framework&#8217;s AMF component. The AMF component provides RPC connectivity that is easy to implement and very efficient. </p>
<h3>Javascript &#8211; 8 Reasons every PHP developer should love it</h3>
<p>After a good lunch and a couple of short talks by phpwomen, fronteers and phpGG it was Boy Baukema&#8217;s (Ibuildings) turn to (try to) make PHP developers like Javascript. On the technical side he pointed out some similarities like closures and closures. Furthermore he showed statics telling us that less than 1% of today&#8217;s user agents don&#8217;t support javascript. This includes search engines and paranoids. After his presentation he repeated his question about how many of us like javascript. I couldn&#8217;t tell much difference but then again, 40 minutes is very little time to convert server-side freaks. In my opinion liking javascript starts with liking to create a good user experience. If you do, you&#8217;ll probably also like Flash and Silverlight. If you don&#8217;t, no problem. Leave it to people who do.</p>
<h3>The frontend is your friend</h3>
<p>The last presentation of the day was given by Robert Jan Verkade (Eend). Interesting and graphically of high quality. Something tells me Robert Jan is a fan of Queen. He focused on the different stakeholders involved in a project and how they interact: The front-end (HTML, CSS, JS), The back-end (PHP), the users and the contractor. He showed some examples of good and bad practice. Most notable advices on of good practice where reducing the number of external css and javascript files and placing javascript at the bottom of the page. Furthermore he had some good tips on how php- and frontend developers can make eachother&#8217;s lives a bit easier. (PHP-ers: Don&#8217;t mess with the HTML! :)).</p>
<p>He put quite some emphasis on valid HTML so I couldn&#8217;t resist asking about wether he meant &#8216;valid&#8217; or &#8216;well formed&#8217; and what his opinion was on using non-W3C attributes to drive javascript behaviour (something I&#8217;m very pragmatic about). An entirely different discussion that doesn&#8217;t need a winner but I was curious if he or someone else would have some interesting (for me new) views on the subject. Somebody in the audience mentioned that custom attributes are part of the HTML5 recommendation. So the topic is definitively &#8216;out there&#8217;.</p>
<p>Conclusion: A nice day. Interesting subject and interesting presentations. And of course it&#8217;s nice to meet some new people working in this field. As it pointed out phpGG has just recently become more active again after having been dormant for a long period. So on that part 2009 looks promising.</p>
<p>For the web 2.0 afficionados: <a href="http://www.flickr.com/photos/tags/phpggfs/">Flickr</a> &amp; <a href="http://search.twitter.com/search?q=phpggfs">Twitter</a> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.tibobeijen.nl/blog/2009/02/08/phpgg-frontend-special/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FireScope &#8211; Firebug extended</title>
		<link>http://www.tibobeijen.nl/blog/2009/01/28/firescope-firebug-extended/</link>
		<comments>http://www.tibobeijen.nl/blog/2009/01/28/firescope-firebug-extended/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 08:28:42 +0000</pubDate>
		<dc:creator>Tibo Beijen</dc:creator>
				<category><![CDATA[miscellaneous]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.yunademo.nl/preview/tibobeijen.nl/?p=87</guid>
		<description><![CDATA[Today I stumbled across an interesting new Firefox extension: FireScope. It&#8217;s developed by Sitepoint, a site I visit regularly. I was aware of their reference material on html, css and javascript and now they use that content to feed this extension. FireScope is an extension to Firebug, assumably known and installed by anyone interested in [...]]]></description>
			<content:encoded><![CDATA[<p>Today I stumbled across an interesting new Firefox extension: <a href="http://tools.sitepoint.com/firescope/">FireScope</a>. It&#8217;s developed by Sitepoint, a site I visit regularly. I was aware of their <a href="http://reference.sitepoint.com/">reference material on html, css and javascript</a> and now they use that content to feed this extension. FireScope is an extension to Firebug, assumably known and installed by anyone interested in FireScope. On the <a href="https://addons.mozilla.org/en-US/firefox/addon/10273">official firefox add-ons page</a> it has the status &#8216;experimental&#8217; and hence requires logging in. On the <a href="http://tools.sitepoint.com/firescope/">FireScope page</a> it can be installed after selecting &#8216;allow&#8217; on the Firefox warning. It looks like Firefox for developers got even better&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tibobeijen.nl/blog/2009/01/28/firescope-firebug-extended/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bye bye old site, welcome new site</title>
		<link>http://www.tibobeijen.nl/blog/2008/11/06/bye-bye-old-site-welcome-new-site/</link>
		<comments>http://www.tibobeijen.nl/blog/2008/11/06/bye-bye-old-site-welcome-new-site/#comments</comments>
		<pubDate>Thu, 06 Nov 2008 16:36:35 +0000</pubDate>
		<dc:creator>Tibo Beijen</dc:creator>
				<category><![CDATA[miscellaneous]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://localhost/tb_wordpress/blog/?p=5</guid>
		<description><![CDATA[As it looks like the blogging phenomenon is there to stay I finally considered it safe to take my first steps into the blogosphere. Until recently this domain showed the website I developed in 2003 and haven&#8217;t updated since. It&#8217;s a technology-push javascript showcase. Something I liked back then (the days when dHTML was fancy) [...]]]></description>
			<content:encoded><![CDATA[<p>As it looks like the blogging phenomenon is there to stay I finally considered it safe to take my first steps into the blogosphere. Until recently this domain showed the website I developed in 2003 and haven&#8217;t updated since. It&#8217;s a technology-push javascript showcase. Something I liked back then (the days when dHTML was fancy) but would never build again now. For starters: It&#8217;s not accessible and thereby not search engine friendly. The popups, if they get past popup-blockers, don&#8217;t help usability either. There are two things I still like though:
</p>
<ul>
<li>It still works. The css, the javascript that keeps everything in place, the event-handling. It proves that standard-compliance can get you far.</li>
<li>It uses a technique similar to what now is called Ajax. Content is loaded by javascript using hidden iFrames and then moved to the visible areas. I liked the days when there was less talking about Ajax&#8230;</li>
</ul>
<p><a href="http://www.tibobeijen.nl/anno2003/">Judge for yourself.</a></p>
<p>Maybe before the end of the decade I&#8217;ll look into that &#8216;twitter&#8217; I keep reading about&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tibobeijen.nl/blog/2008/11/06/bye-bye-old-site-welcome-new-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

