<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>MikedeBoer.nl</title>
	
	<link>http://www.mikedeboer.nl</link>
	<description>One Singleton to control the Universe</description>
	<pubDate>Thu, 17 Dec 2009 11:54:51 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/mikedeboernl" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="mikedeboernl" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>The Future of Web Development</title>
		<link>http://www.mikedeboer.nl/2009/12/the-future-of-web-development/</link>
		<comments>http://www.mikedeboer.nl/2009/12/the-future-of-web-development/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 16:20:34 +0000</pubDate>
		<dc:creator>mikedeboer</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[article]]></category>

		<category><![CDATA[discuss]]></category>

		<category><![CDATA[future]]></category>

		<category><![CDATA[IDE]]></category>

		<category><![CDATA[OLE]]></category>

		<category><![CDATA[rant]]></category>

		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://www.mikedeboer.nl/?p=262</guid>
		<description><![CDATA[Let's try not to re-invent the wheel, but make developing web applications easier for all by building upon decades of knowledge in computer science and User Interaction and Design studies.]]></description>
			<content:encoded><![CDATA[<p>(&#8230;my not so humble opinion.)</p>
<div class="wp-caption alignleft" style="width: 249px"><img title="Delphi 3 Box" src="http://images4.wikia.nocookie.net/delphi/images/e/ed/D3StdBox.jpg" alt="Delphi 3 Box" width="239" height="300" /><p class="wp-caption-text">Delphi 3 Box</p></div>
<p>Back in the days when I was still a naive little boy, full of potential, wits and enthusiasm for user interfaces on a peecee, I made my first ever UI in Delphi 3. Personal Edition. It was supposed to become the most advanced, but simplest to operate ceedee burning program ever, in an apple-esque fashion. All it eventually did was start up, show the UI and the &#8216;Close&#8217; feature worked perfectly as well.<br />
Instead of feeling miserable or like a failure, I really felt good about it. I started and closed my &#8216;ultimate ceedee burning program&#8217; again and again and again to marvel at its impeccable design. I never showed it to anyone else.<br />
The power that development tools for desktop application give - even to little kids that are just fooling around - inspired me to think about how we webfolk could leverage the principles and ideas that lie within.<br />
The power that a GUI builder (usually a feature inside an Integrated Development Environment) exposes is the ability to create UIs to users that do not necessarily need a technical background in order to use it. Fantastic, potentially functional designs can be created for Windows desktop apps in <a href="http://en.wikipedia.org/wiki/Microsoft_Visual_Studio" target="_blank">Visual Studio</a>, ye olde <a href="http://en.wikipedia.org/wiki/Borland_Delphi" target="_blank">Delphi</a> or more specialised tools. Mac OS has the wonderful <a href="http://en.wikipedia.org/wiki/Interface_Builder" target="_blank">Interface builder</a> that comes with XCode for Cocoa apps. With those tools at hand, it&#8217;s not really rocket-science to create a User Interface. In fact, the tools allow specialised UI Designers and User Interaction designers to create mockups and even prototypes with limited functionality.<br />
The Ultimate ceedee burning app I created during my wild days was actually my first-ever working prototype. All I&#8217;m trying to say really, is that if even a kid can do it, surely there must be real value there.</p>
<p>Latest trends in the web development industry have been gearing toward porting existing desktop applications to work in a web browser. Our email reading software is moving to a web application like GMail or Live Mail; golden oldies like Thunderbird, Outlook and Mail.app are bound to be left alone eventually. Office suites like OpenOffice.org and MS Office can be replaced - or augmented, whatever - by Google Docs or Office Live.<br />
Recently Google announced its <a href="http://googleblog.blogspot.com/2009/07/introducing-google-chrome-os.html" target="_blank">Chrome OS</a> to the world and promised that within a year we&#8217;ll see the first Netbooks coming out with Chrome OS pre-installed. The most important thing about Chrome OS is that it&#8217;s really a shell around its web browser, Chrome. All applications that you&#8217;ll be able to run in Chrome OS will be web applications.<br />
A lot of my friends - who also happen to be of the web developer breed - cheered when Google announced its plans for a web-centric OS, including yours truly. But, in fact we ought to have been scared shitless&#8230; what&#8217;s a web OS worth without a convincing set of web applications? How can users migrate to such an OS without thinking twice and leaving their precious desktop workflow behind? Over the years, a slew of very smart people pondered and chipped in on conceptual user interface and interaction design. Wouldn&#8217;t it be a waste if all that valuable knowledge and proof is trashed, binned, set on fire and pissed on by a small set of cocky web developers?<br />
No, with the current state of web application development, we cannot expect people to switch to web apps, let alone a web OS. We are still missing architectural components, like a system that provides a common bridge and transport of objects between web applications - comparable to <a href="http://en.wikipedia.org/wiki/Object_Linking_and_Embedding" target="_blank">OLE</a>. I don&#8217;t know about you, but I&#8217;m quite attached to dragging my favorite Youtube videos and dropping them in a Google Docs document&#8230;<br />
But the core feature, the heartbeat of any OS competitive to Windows, is choice. And at the moment, we&#8217;re already having trouble coming up with one decent alternative for each commonly used desktop application. Take text editors, for example. Coders/ programmers are quite picky and opinionated when you ask them what their favorite editor is, mainly because there&#8217;s a plethora of choice: VIm, Emacs, joe, pico, nano, Textmate, phpEd, Notepad(++), Slickedit, Editpad, Editra, UltraEdit, etc. What alternative would we have in a web OS? <a href="https://mozillalabs.com/bespin/" target="_blank">Bespin</a>, and&#8230; well, that&#8217;s it really. I don&#8217;t have to explain to you that that&#8217;s unacceptable, I at least will not switch to any OS if I would be forced to use Bespin as my editor and leave precious TextMate behind&#8230; CHOICE!</p>
<p>The only way I believe we can make strides into offering more choice to users, thus quickly expanding the amount choice in web applications, is to retain existing knowledge of user interface and interaction design. We need to create tools that with which web UIs can be developed just as easily as with modern desktop tools. In other words, we need GUI builders and mockup design tools that implement and grok current dogmas and principles of designing UIs, potentially usable for kids.<br />
The first and only effort in that direction at the moment is <a href="http://280atlas.com/" target="_blank">Atlas</a>, by the 280 North team. It&#8217;s a tool that is inspired by the GUI builder of XCode and design principles of the Mac OS. It&#8217;s a fantastic product and idea with lots of potential, but pretty much worthless if there won&#8217;t be more choice in comparable tools soon. On top of that: the Atlas project and technology behind it is not mature yet, so it&#8217;s debatable if desktop application replacements can be developed with Atlas and Cappuccino. But, I&#8217;m biased: at <a href="http://ajax.org" target="_blank">Ajax.org</a>, we&#8217;re going to try and start offering choice with our own IDE and GUI Builder. Again, because we need more choice in tools that are all about user-centric, not feature-centric design.</p>
<p>Let&#8217;s try not to re-invent the wheel, but make developing web applications easier for all by building upon decades of knowledge in computer science and User Interaction and Design studies.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikedeboer.nl/2009/12/the-future-of-web-development/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Let’s meet at JSConf in November!</title>
		<link>http://www.mikedeboer.nl/2009/10/lets-meet-at-jsconf-in-november/</link>
		<comments>http://www.mikedeboer.nl/2009/10/lets-meet-at-jsconf-in-november/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 14:59:25 +0000</pubDate>
		<dc:creator>mikedeboer</dc:creator>
		
		<category><![CDATA[Ajax.org]]></category>

		<category><![CDATA[Conference]]></category>

		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[Javeline]]></category>

		<category><![CDATA[Open Source]]></category>

		<category><![CDATA[jsconf]]></category>

		<guid isPermaLink="false">http://www.mikedeboer.nl/?p=252</guid>
		<description><![CDATA[I&#8217;m very happy to announce that my beloved open source project is announced over at JSConf EU as an Advanced Silver Sponsor!
Additionally, Ruben Daniels and I will be presenting about the new APF version and the insane stuff you can build with it:
Title: Building collaborative applications with Ajax.org Platform
Abstract/ About: Web trends and technologies today [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m very happy to announce that my beloved open source project is announced over at <a href="http://jsconf.eu/2009">JSConf EU</a> as an Advanced Silver Sponsor!</p>
<p>Additionally, <a href="http://www.rubendaniels.com">Ruben Daniels</a> and I will be presenting about the new APF version and the insane stuff you can build with it:</p>
<p>Title: <strong>Building collaborative applications with Ajax.org Platform</strong><br />
Abstract/ About: Web trends and technologies today are converging to do one thing particularly well: collaborate.<br />
All of us dream about the possibility to weave collaborative features from products like Google Wave, EtherPad, SubEthaEdit, Mozilla Bespin, Google Docs into our own applications.<br />
Ajax.org Platform combines technology and open standards into a solution to build web applications with rich collaborative features at minimum expense.<br />
The simple-yet-elegant, declarative API makes it easier to learn, while its openness in design allows it to be extended to the level you and your team are comfortable with.<br />
Forget lock-in of vendors and other libraries or frameworks, forget waiting for the Big Boys to open source their latest inventions.<br />
Start building your next - or first - collaborative web application today, visit ajax.org.</p>
<p>I&#8217;m really looking forward to meet all of the cool people that will be attending the very first  JSConf in Europe!<br />
The ones who are lucky enough to have obtained a ticket can really call themselves the avant-garde of the Javascript community <img src='http://www.mikedeboer.nl/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>I hope to see you there!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikedeboer.nl/2009/10/lets-meet-at-jsconf-in-november/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ajax.org Platform 3.0 delayed a bit…</title>
		<link>http://www.mikedeboer.nl/2009/10/ajaxorg-platform-30-delayed-a-bit/</link>
		<comments>http://www.mikedeboer.nl/2009/10/ajaxorg-platform-30-delayed-a-bit/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 15:26:39 +0000</pubDate>
		<dc:creator>mikedeboer</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.mikedeboer.nl/?p=247</guid>
		<description><![CDATA[While having a blast in Boston at The Ajax Experience (#tae), we received loads of feedback to our plans and thoughts.
We decided to act upon that and started hacking again on APF, so that it would incorporate all those ideas into one, awesome release.
This basically meant a major refactor on top of what we already [...]]]></description>
			<content:encoded><![CDATA[<p>While having a blast in Boston at <a href="http://ajaxexperience.techtarget.com/conference/index.html">The Ajax Experience</a> (#tae), we received loads of feedback to our plans and thoughts.</p>
<p>We decided to act upon that and started hacking again on APF, so that it would incorporate all those ideas into one, awesome release.</p>
<p>This basically meant a major refactor on top of what we already did up till before #tae. Guess what that means&#8230; a delay!</p>
<p>Yepper, it will take us at least a week from now to complete and stabilize the lot to reach Beta quality.</p>
<p>Will it be worth the wait? You decide:</p>
<ul>
<li>contentEditable=&#8221;true&#8221; on any element</li>
<li>DOM3 including DOM events support</li>
<li>Choose between declarative XML and JSON markup to build UI&#8217;s</li>
<li>New language to bind widgets to each other and widgets to data</li>
<li>Tons of fixes of bugs and annoyances</li>
<li>IDE in the making&#8230;</li>
<li>more&#8230;</li>
</ul>
<p>The release will be announced together with a new version of the Ajax.org website - hey it&#8217;s build with APF, so that makes sense, right? - and also on this blog.</p>
<p>Stay tuned and thanks so much for your patience!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikedeboer.nl/2009/10/ajaxorg-platform-30-delayed-a-bit/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Visual communication with Jing</title>
		<link>http://www.mikedeboer.nl/2009/03/visual-communication-with-jing/</link>
		<comments>http://www.mikedeboer.nl/2009/03/visual-communication-with-jing/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 15:47:25 +0000</pubDate>
		<dc:creator>mikedeboer</dc:creator>
		
		<category><![CDATA[Gems]]></category>

		<category><![CDATA[Javeline]]></category>

		<category><![CDATA[Multimedia]]></category>

		<category><![CDATA[jing]]></category>

		<category><![CDATA[screencast]]></category>

		<category><![CDATA[screenshot]]></category>

		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://www.mikedeboer.nl/?p=238</guid>
		<description><![CDATA[I&#8217;ve been using this tool for a couple of months now, together with my colleagues at Javeline, and it has proven itself to be a power tool. If I want to show off a (supposedly) cool new thing I&#8217;m working on, or visualize this nasty bug that my co-worker promised to fix months ago, I [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using this tool for a couple of months now, together with my colleagues at <a title="Javeline.com Website" href="http://www.javeline.com" target="_blank">Javeline</a>, and it has proven itself to be a power tool. If I want to show off a (supposedly) cool new thing I&#8217;m working on, or visualize this nasty bug that my co-worker promised to fix months ago, I press &#8216;Command+Shift+1&#8242; automatically now; <a title="Jing homepage" href="http://www.jingproject.com" target="_blank">Jing</a> captures what I&#8217;m doing in image or video quality and afterwards I can upload it to my account at Screencast.com with the push of a button. It puts the short URL to my video clip on the clipboard, so that I can paste it in into my chat conversation or blog article right away:</p>
<p><a title="See for yourself!" href="http://screencast.com/t/ojI7mlTF2" target="_blank">http://screencast.com/t/ojI7mlTF2</a></p>
<p>It just works. Nice.</p>
<p>It&#8217;s free, works on Windows and Mac OS X.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikedeboer.nl/2009/03/visual-communication-with-jing/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Introducing HTML5 features… now! (Part one)</title>
		<link>http://www.mikedeboer.nl/2008/11/introducing-html5-features-now-part-one/</link>
		<comments>http://www.mikedeboer.nl/2008/11/introducing-html5-features-now-part-one/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 16:05:35 +0000</pubDate>
		<dc:creator>mikedeboer</dc:creator>
		
		<category><![CDATA[Articles]]></category>

		<category><![CDATA[HTML5]]></category>

		<category><![CDATA[Javeline]]></category>

		<category><![CDATA[Multimedia]]></category>

		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://www.mikedeboer.nl/?p=48</guid>
		<description><![CDATA[We think the HTML5 specification, published and maintained by the WHATWG, and the Open Web initiative are beautiful entry points to jump start a new generation of Internet applications. There is one downside to these endeavors: we web developers need to wait for browser vendors to implement features like the &#60;audio&#62; tag, &#60;video&#62; tag, undo/ [...]]]></description>
			<content:encoded><![CDATA[<p>We think the <a title="Read up on the spec!" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/" target="_blank">HTML5</a> specification, published and maintained by the <a title="WHATWG homepage (blog)" href="http://blog.whatwg.org/" target="_blank">WHATWG</a>, and the Open Web initiative are beautiful entry points to jump start a new generation of Internet applications. There is one downside to these endeavors: we web developers need to wait for browser vendors to implement features like the &lt;audio&gt; tag, &lt;video&gt; tag, undo/ redo, local storage, cross-domain XHR, validation, etc. And even when these features are implemented inside the new browser versions, we still need to wait for them to hit mainstream and replace the old versions. But we don&#8217;t want to wait, we want them now!<br />
<span id="more-48"></span></p>
<div style="position:relative;"> </div>
<p><script src="http://cdn.ajax.org/platform/1.0rc1/jpf_av5.1.0rc1.js"><!--
    <j:bar resizable="true" width="500" height="355" minwidth="400" minheight="250" maxwidth="720" xmlns:j="http://www.javeline.com/2005/jml">
        <j:video id="player1" autoplay="true" volume="50" controls="false"
          left="2" right="4" top="2" bottom="30">
            <j:source src="http://cdn.mikedeboer.nl/jaudio_jvideo_1_1.flv"> </j:source>
            <j:source src="http://cdn.mikedeboer.nl/jaudio_jvideo_1_1.mov"> </j:source>
            <j:source src="http://cdn.mikedeboer.nl/jaudio_jvideo_1_1.wmv" type="video/silverlight"> </j:source>
            <j:nomedia>Video Codec not supported.</j:nomedia>
        </j:video></p>
<p>        <j:button background="{!player1.paused?'pause.png':'play.png'}"
            onclick="player1.paused ? player1.play() : player1.pause()">
        </j:button></p>
<p>        <j:label value = "{player1.getCounter(player1.currentTime, '%M:%S')}" class="jpf_counter" disabled="{!player1.READY}"></j:label>
        <j:slider skin="slider16" value="[player1.position]" enabled="{player1.READY}" progress = "{player1.progress}" left="85" right="182" realtime="false"></j:slider>
        <j:label value="{player1.getCounter(player1.currentTime, '%M:%S', true)}" class="jpf_countdown" disabled="{!player1.READY}"></j:label>
        <j:button background="{!player1.muted ? 'volume.gif':'volume_mute.gif'}"
            onclick = "player1.setAttribute('muted', !player1.muted)"
            class   = "jpf_mute"> </j:button>
        <j:label value="{Math.round(player1.volume)}" class="jpf_volume" disabled="{player1.muted}"></j:label>
        <j:slider width="80" value="[player1.volume]" min="0" max="100" disabled="{player1.muted}"></j:slider>
    </j:bar>
 &#8211;></script><!--wordpress hack--><script type="text/javascript"></script></p>
<p style="margin:0 0 15px 0">
Note: The screencast software I&#8217;m using seemed to flicker a bit. I&#8217;m a first time user, I&#8217;ll hope to get it fixed next time.
</p>
<p>The last couple of months we at Javeline have been working hard to get the <a title="The new, improved Ajax.org" href="http://www.ajax.org" target="_blank">open source Javeline Platform</a> (JPF) ready for this new generation. The first showcase I present to you here is an implementation of the HTML5 <a title="Read the spec" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#video" target="_blank">&lt;video&gt;</a> and <a title="Read the spec" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#audio" target="_blank">&lt;audio&gt;</a> elements, with two key differences:</p>
<ol>
<li>The &#8216;j&#8217; - namespace, so they are called &lt;j:audio&gt; and &lt;j:video&gt;. This difference is not really shocking, I know, but quite essential, because it enables a lot of features that Javeline Platform can provide. You can see it in action in the screencast below.</li>
<li>Since we cannot wait for the right A/V codec for the browser to stand up, we have to support them all: Apple Quicktime for .mov files and podcasts for example, Silverlight and Windows Media Player for .wmv files and streaming WMP, Flash for <a href="http://labs.adobe.com/wiki/index.php/Flash-Ajax_Video_Component">.flv</a> and <a href="http://www.schillmania.com/projects/soundmanager2/">.mp3</a> files and <a href="https://videolan.org/vlc/">VLC</a> for .ogg files. In fact, VLC is also the default player for Linux clients, because it features the only reasonably functioning browser-plugin on that platform.</li>
</ol>
<p><!--more--></p>
<h2>So how does it work?</h2>
<p>Well, the basic syntax for a standard &lt;j:video&gt; element looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;j:video</span> </span>
<span style="color: #009900;">  id  = <span style="color: #ff0000;">&quot;myVideo1&quot;</span> </span>
<span style="color: #009900;">  src = <span style="color: #ff0000;">&quot;http://url_to_your_video.mov&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>  
    Video Codec not supported. 
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/j:video<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>And the code for a standard &lt;j:audio&gt; element looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;j:audio</span> </span>
<span style="color: #009900;">  id  = <span style="color: #ff0000;">&quot;myAudio1&quot;</span> </span>
<span style="color: #009900;">  src = <span style="color: #ff0000;">&quot;http://url_to_your_audio.mp3&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>  
    Audio Codec not supported. 
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/j:audio<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Basically what I&#8217;ve done is</p>
<ul>
<li>implemented the HTMLMediaElement interface</li>
<li>gathered all the knowledge that is available about scripting the media player controls that can play media inside browsers and implemented those API&#8217;s as a layer on top of the HTMLMediaElement interface.</li>
</ul>
<p>The result is a cross-browser and cross-platform solution for embedding rich media into your web application or static webpage - like on this blog - that can be controlled fully with Javascript! In other words: the &lt;audio&gt; and &lt;video&gt; tags are now a real thing, whereas you - webdeveloper - don&#8217;t need to wait any longer. We want HTML5 and we want it now!<br />
At the bottom of this article you will find a full demonstration of the &lt;j:video&gt; tag. It shows a screencast with me explaining how to use the &lt;j:video&gt; and &lt;j:audio&gt; for your own web application(s).</p>
<p>Next, I will show you how to add player controls to both &lt;j:video&gt; and &lt;j:audio&gt; elements. Since they share the same ancestor - the HTMLMediaElement interface - I can show the player controls for the &lt;j:video&gt; example first and simply reuse it for the &lt;j:audio&gt; example.</p>
<h3>Playback control.</h3>
<p>The HTMLMediaElement specifies a couple of accessor methods that enable developers to control the playback of a media file, like &#8216;play()&#8217;, &#8216;pause()&#8217; and &#8216;<a href="http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2008-November/017212.html">canPlayType()</a>&#8216;.<br />
Example: say you want to give a visitor basic control over the video and/ or audio files you provide, but want them to have the same look and feel as your web application. From a usability and interface design perspective this is quite important. Since you can now control the &lt;j:video&gt; and &lt;j:audio&gt; elements with simple accessor methods you may use your own button widgets to add a Play and Pause button. The onclick event would in this case fire &#8216;myVideo1.play()&#8217; and &#8216;myVideo1.pause()&#8217; respectively. Really, it&#8217;s that simple:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;j:video</span> id = <span style="color: #ff0000;">&quot;myVideo1&quot;</span> </span>
<span style="color: #009900;">  src      = <span style="color: #ff0000;">&quot;http://url_to_your_video.mov&quot;</span> </span>
<span style="color: #009900;">  autoplay = <span style="color: #ff0000;">&quot;true&quot;</span> </span>
<span style="color: #009900;">  controls = <span style="color: #ff0000;">&quot;false&quot;</span> </span>
<span style="color: #009900;">  volume   = <span style="color: #ff0000;">&quot;90&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>  
    Video Codec not supported. 
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/j:video<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;j:button</span> </span>
<span style="color: #009900;">  background = <span style="color: #ff0000;">&quot;{!myVideo1.paused?'pause.png':'play.png'}&quot;</span> </span>
<span style="color: #009900;">  onclick    = <span style="color: #ff0000;">&quot;myVideo1.paused ? myVideo1.play() : myVideo1.pause()&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span> 
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;j:label</span> value = <span style="color: #ff0000;">&quot;{myVideo1.getCounter(myVideo1.currentTime, '%M:%S')}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span> 
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;j:slider</span> </span>
<span style="color: #009900;">  realtime = <span style="color: #ff0000;">&quot;false&quot;</span> </span>
<span style="color: #009900;">  value    = <span style="color: #ff0000;">&quot;[myVideo1.position]&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span> 
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;j:label</span> </span>
<span style="color: #009900;">  value = <span style="color: #ff0000;">&quot;{myVideo1.getCounter(myVideo1.currentTime, '%M:%S', true)}&quot;</span> </span>
<span style="color: #009900;">  class = <span style="color: #ff0000;">&quot;jpf_countdown&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span> 
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;j:label</span> </span>
<span style="color: #009900;">  value = <span style="color: #ff0000;">&quot;{Math.round(myVideo1.volume)}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;j:slider</span> </span>
<span style="color: #009900;">  width = <span style="color: #ff0000;">&quot;80&quot;</span> </span>
<span style="color: #009900;">  value = <span style="color: #ff0000;">&quot;[myVideo1.volume]&quot;</span> </span>
<span style="color: #009900;">  min   = <span style="color: #ff0000;">&quot;0&quot;</span> </span>
<span style="color: #009900;">  max   = <span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>You can use the &#8216;getCounter()&#8217; function to transform the currentTime from milliseconds to a human readable format. The modifier &#8216;%M:%S&#8217; displays a currentTime value of 360,000 as &#8216;06:00&#8242;. A third argument specified as &#8216;true&#8217; (Boolean) will return a countdown.</p>
<p>Javeline Platform supports two-way property binding. In other words: your controls are not limited to listening to changing properties, but may also change it themselves. You can now grab the knob of the slider control and seek through the movie or sound! I&#8217;d say give it a whirl, it&#8217;s quite fun to do once you know it&#8217;s Javascript doing the dirty work&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// Curly brackets: one way property binding (read-only)</span>
<span style="color: #009900;">&#123;</span>Math.<span style="color: #660066;">round</span><span style="color: #009900;">&#40;</span>myVideo1.<span style="color: #660066;">volume</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span> 
&nbsp;
<span style="color: #006600; font-style: italic;">// Square brackets: two way property binding (read-write)</span>
<span style="color: #009900;">&#91;</span>myVideo1.<span style="color: #660066;">position</span><span style="color: #009900;">&#93;</span></pre></div></div>

<h3>Let&#8217;s add some style</h3>
<p>Styling in JPF is done with skins, which is something I would love to explain in a later article, but for now I&#8217;ll stick with the notion of their existence.<br />
When I apply some basic styling rules, the code will look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;j:bar</span> <span style="color: #000066;">resizable</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;482&quot;</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;353&quot;</span> <span style="color: #000066;">minwidth</span>=<span style="color: #ff0000;">&quot;400&quot;</span> </span>
<span style="color: #009900;">  <span style="color: #000066;">minheight</span>=<span style="color: #ff0000;">&quot;250&quot;</span> <span style="color: #000066;">xmlns:j</span>=<span style="color: #ff0000;">&quot;http://www.javeline.com/2005/jml&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;j:video</span> id = <span style="color: #ff0000;">&quot;myVideo1&quot;</span> </span>
<span style="color: #009900;">      src      = <span style="color: #ff0000;">&quot;http://url_to_your_video.mov&quot;</span> </span>
<span style="color: #009900;">      autoplay = <span style="color: #ff0000;">&quot;true&quot;</span> </span>
<span style="color: #009900;">      controls = <span style="color: #ff0000;">&quot;false&quot;</span> </span>
<span style="color: #009900;">      volume   = <span style="color: #ff0000;">&quot;90&quot;</span></span>
<span style="color: #009900;">      left = <span style="color: #ff0000;">&quot;2&quot;</span> right = <span style="color: #ff0000;">&quot;4&quot;</span> top = <span style="color: #ff0000;">&quot;2&quot;</span> bottom = <span style="color: #ff0000;">&quot;30&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>  
        Video Codec not supported. 
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/j:video<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;j:button</span> </span>
<span style="color: #009900;">      background = <span style="color: #ff0000;">&quot;{!myVideo1.paused?'pause.png':'play.png'}&quot;</span> </span>
<span style="color: #009900;">      onclick    = <span style="color: #ff0000;">&quot;myVideo1.paused ? myVideo1.play() : myVideo1.pause()&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span> 
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;j:label</span> </span>
<span style="color: #009900;">      value = <span style="color: #ff0000;">&quot;{myVideo1.getCounter(myVideo1.currentTime, '%M:%S')}&quot;</span> </span>
<span style="color: #009900;">      class = <span style="color: #ff0000;">&quot;jpf_counter&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span> 
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;j:slider</span> </span>
<span style="color: #009900;">      realtime = <span style="color: #ff0000;">&quot;false&quot;</span> </span>
<span style="color: #009900;">      skin     = <span style="color: #ff0000;">&quot;slider16&quot;</span> </span>
<span style="color: #009900;">      value    = <span style="color: #ff0000;">&quot;[myVideo1.position]&quot;</span> </span>
<span style="color: #009900;">      left     = <span style="color: #ff0000;">&quot;80&quot;</span> </span>
<span style="color: #009900;">      right    = <span style="color: #ff0000;">&quot;182&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span> 
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;j:label</span> </span>
<span style="color: #009900;">      value = <span style="color: #ff0000;">&quot;{myVideo1.getCounter(myVideo1.currentTime, '%M:%S', true)}&quot;</span> </span>
<span style="color: #009900;">      class = <span style="color: #ff0000;">&quot;jpf_countdown&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span> 
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;j:label</span> </span>
<span style="color: #009900;">      <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;{Math.round(myVideo1.volume)}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;j:slider</span> </span>
<span style="color: #009900;">      width = <span style="color: #ff0000;">&quot;80&quot;</span> </span>
<span style="color: #009900;">      value = <span style="color: #ff0000;">&quot;[myVideo1.volume]&quot;</span> </span>
<span style="color: #009900;">      min   = <span style="color: #ff0000;">&quot;0&quot;</span> </span>
<span style="color: #009900;">      max   = <span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span> 
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/j:bar<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>As you might have noticed, I just added a &#8216;&lt;j:bar&gt;&#8217; element, which basically serves as a container element for the video and player control elements. The advantages of using a &lt;j:bar&gt; here instead of a &lt;div&gt; are twofold: 1) I&#8217;m able to use a skin like with all the other elements and 2) I can now use the &#8216;resizable&#8217; attribute, with which I can make the entire video player resizable with drag and drop by setting it to &#8216;true&#8217;. Read all about it - and more - on the next page&#8230;</p>
<h3>ResizeMe!</h3>
<p>Well, I&#8217;ll be short on this one: setting the &#8216;resizable&#8217; attribute on any visual Javeline Markup Language (JML) element makes it resizable by dragging the borders and dropping them at their new position(s). With additional properties like &#8216;minwidth&#8217;, &#8216;minheight&#8217;, &#8216;maxwidth&#8217; and &#8216;maxheight&#8217; you can enforce the necessary constraints on the resizing behavior. Simply put: check out the video player in this article, grab one of its corners and drag it around!</p>
<h3>DOM operations</h3>
<p>Both &lt;j:video&gt; and &lt;j:audio&gt; elements can be modified and controlled in real time using standard DOM operations.<br />
Example: say we have a list of videos that a visitor of your site can pick from. Since it is a web application, no page refresh should happen, not even when the user starts switching between videos. That&#8217;s where setAttribute comes in to play; when the user selects another video, a simple setAttribute(&#8217;src&#8217;, &#8216;new_video.mov&#8217;) will do the trick! You can see me showing a couple more DOM operations in the screencast below.</p>
<h3>Cut and paste for your blog</h3>
<p>You can copy and paste the code below and you&#8217;ll get the same result on your own pages instantly (it includes the elements in a way that works well with blog editors like wordpress and blogspot). What&#8217;s left for you to do is build beautiful interfaces and enhance those web application with stunning rich media!</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;script</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;http://cdn.ajax.org/platform/1.0rc1/jpf_av5.1.0rc1.js&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #808080; font-style: italic;">&lt;!--</span>
<span style="color: #808080; font-style: italic;">    &lt;j:bar resizable=&quot;true&quot; width=&quot;482&quot; height=&quot;353&quot; minwidth=&quot;400&quot; minheight=&quot;250&quot; maxwidth=&quot;500&quot; xmlns:j=&quot;http://www.javeline.com/2005/jml&quot;&gt;</span>
<span style="color: #808080; font-style: italic;">        &lt;j:video id=&quot;player1&quot; autoplay=&quot;true&quot; volume=&quot;50&quot; controls=&quot;false&quot;</span>
<span style="color: #808080; font-style: italic;">          left=&quot;2&quot; right=&quot;4&quot; top=&quot;2&quot; bottom=&quot;30&quot;&gt;</span>
<span style="color: #808080; font-style: italic;">            &lt;j:source src=&quot;http://cdn.mikedeboer.nl/jaudio_jvideo_1_1.flv&quot;&gt;&lt;/j:source&gt;</span>
<span style="color: #808080; font-style: italic;">            &lt;j:source src=&quot;http://cdn.mikedeboer.nl/jaudio_jvideo_1_1.mov&quot;&gt;&lt;/j:source&gt;</span>
<span style="color: #808080; font-style: italic;">            &lt;j:source src=&quot;http://cdn.mikedeboer.nl/jaudio_jvideo_1_1.wmv&quot; type=&quot;video/silverlight&quot;&gt;&lt;/j:source&gt;</span>
<span style="color: #808080; font-style: italic;">            &lt;j:nomedia&gt;Video Codec not supported.&lt;/j:nomedia&gt;</span>
<span style="color: #808080; font-style: italic;">        &lt;/j:video&gt;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">        &lt;j:button background=&quot;{!player1.paused?'pause.png':'play.png'}&quot;</span>
<span style="color: #808080; font-style: italic;">            onclick=&quot;player1.paused ? player1.play() : player1.pause()&quot;&gt;</span>
<span style="color: #808080; font-style: italic;">        &lt;/j:button&gt;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">        &lt;j:label value=&quot;{player1.getCounter(player1.currentTime, '%M:%S')}&quot; class=&quot;jpf_counter&quot; disabled=&quot;{!player1.READY}&quot;&gt;&lt;/j:label&gt;</span>
<span style="color: #808080; font-style: italic;">        &lt;j:slider skin=&quot;slider16&quot; value=&quot;[player1.position]&quot; enabled=&quot;{player1.READY}&quot; left=&quot;85&quot; right=&quot;182&quot; realtime=&quot;false&quot;&gt;&lt;/j:slider&gt;</span>
<span style="color: #808080; font-style: italic;">        &lt;j:label value=&quot;{player1.getCounter(player1.currentTime, '%M:%S', true)}&quot; class=&quot;jpf_countdown&quot; disabled=&quot;{!player1.READY}&quot;&gt;&lt;/j:label&gt;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">        &lt;j:button background=&quot;{!player1.muted ? 'volume.gif':'volume_mute.gif'}&quot; onclick=&quot;player1.setAttribute('muted', !player1.muted)&quot; class=&quot;jpf_mute&quot;&gt;&lt;/j:button&gt;</span>
<span style="color: #808080; font-style: italic;">        &lt;j:label value=&quot;{Math.round(player1.volume)}&quot; class=&quot;jpf_volume&quot; disabled=&quot;{player1.muted}&quot;&gt;&lt;/j:label&gt;</span>
<span style="color: #808080; font-style: italic;">        &lt;j:slider width=&quot;80&quot; value=&quot;[player1.volume]&quot; min=&quot;0&quot; max=&quot;100&quot; disabled=&quot;{player1.muted}&quot;&gt;&lt;/j:slider&gt;</span>
<span style="color: #808080; font-style: italic;">    &lt;/j:bar&gt;</span>
<span style="color: #808080; font-style: italic;"> --&gt;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><span style="color: #808080; font-style: italic;">&lt;!--wordpress hack--&gt;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;script</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<h3>Conclusion</h3>
<p>We tried to solve the hard problems, gather all available knowledge on scripting player controls and provide them to you in a &#8216;ready-to-roll&#8217; package. The final release of the video/audio tag will include auto detecting available plugins instead of only trying the preferred plugin for the specified format. This will solve all the multi os problems that are there. </p>
<p>I would love to hear all comments and feedback you have. As the HTML5 spec is subject to change almost every day, I think that the &lt;j:video&gt; and &lt;j:audio&gt; elements will be subject to change as well. I hope this showcase will spur more discussion about the next generation of browser interfaces and we at Javeline would love to chime in with this little contribution.</p>
<h2>More to come&#8230;</h2>
<p>As I mentioned earlier in this article, we&#8217;ve been working hard and implemented quite a few more features of the HTML5 specification in the upcoming JPF 1.0 RC1 version, which is due to be released soon, so stay tuned!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikedeboer.nl/2008/11/introducing-html5-features-now-part-one/feed/</wfw:commentRss>
<enclosure url="http://cdn.mikedeboer.nl/jaudio_jvideo_1_1.mov" length="39339530" type="video/quick" />
<enclosure url="http://cdn.mikedeboer.nl/jaudio_jvideo_1_1.wmv" length="28294542" type="video/x-ms-wmv" />
		</item>
		<item>
		<title>Did you know that JS can be weird sometimes?</title>
		<link>http://www.mikedeboer.nl/2008/09/did-you-know-that-js-can-be-weird-sometimes/</link>
		<comments>http://www.mikedeboer.nl/2008/09/did-you-know-that-js-can-be-weird-sometimes/#comments</comments>
		<pubDate>Fri, 05 Sep 2008 14:13:05 +0000</pubDate>
		<dc:creator>mikedeboer</dc:creator>
		
		<category><![CDATA[ECMA]]></category>

		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[didyouknow]]></category>

		<category><![CDATA[easteregg]]></category>

		<category><![CDATA[weird]]></category>

		<guid isPermaLink="false">http://www.mikedeboer.nl/?p=39</guid>
		<description><![CDATA[Of course you did, otherwise you wouldn&#8217;t read this! Anyway, I found this little easter egg in Javascript land:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function test&#40;&#41;&#123;
    var privateVar = 10;
    function tryXs&#40;&#41;&#123;
        if &#40;false&#41; &#123;
            var privateVar [...]]]></description>
			<content:encoded><![CDATA[<p>Of course you did, otherwise you wouldn&#8217;t read this! Anyway, I found this little easter egg in Javascript land:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> test<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> privateVar <span style="color: #339933;">=</span> <span style="color: #CC0000;">10</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">function</span> tryXs<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003366; font-weight: bold;">var</span> privateVar <span style="color: #339933;">=</span> <span style="color: #CC0000;">5</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>privateVar<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">callme</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>
        tryXs.<span style="color: #660066;">call</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: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> oTest <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> test<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
oTest.<span style="color: #660066;">callme</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Now what do you think what will the alert() show us? UNDEFINED! Now why would that be???<br />
Well, apparently the &#8216;var&#8217; in</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> privateVar <span style="color: #339933;">=</span> <span style="color: #CC0000;">5</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>screws things up for us; even though the if-statement is evaluated to FALSE at all times, thus never executing the statement body (&#8217;var privateVar = 5&#8242;). Reasonably, you&#8217;d expect the alert dialog to display the value &#8216;10&#8242;, but apparently it still parses the body of the if-statement and pulls a string of the variable scoping rules.<br />
Want to hear something even more weird? It&#8217;s consistent behavior! This occurs in all major browsers (I tested IE 6, FF 3.0.1, Opera 9.51 and Safari 3.1.2) and the alert shows &#8216;10&#8242; when you remove the &#8216;var&#8217; from &#8216;var privateVar = 5&#8242;. That actually makes sense again!</p>
<p>I&#8217;m quite interested to see and hear if anyone can give me an explanation for this behavior, because I probably lack the skill(s) to see any practical use in this &#8216;feature&#8217; ;).<br />
Does anyone else know a weird Javascript nugget like this?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikedeboer.nl/2008/09/did-you-know-that-js-can-be-weird-sometimes/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Fun with Ubiquity</title>
		<link>http://www.mikedeboer.nl/2008/08/fun-with-ubiquity/</link>
		<comments>http://www.mikedeboer.nl/2008/08/fun-with-ubiquity/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 15:39:23 +0000</pubDate>
		<dc:creator>mikedeboer</dc:creator>
		
		<category><![CDATA[Ubiquity]]></category>

		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[mozilla]]></category>

		<category><![CDATA[ubiquity]]></category>

		<guid isPermaLink="false">http://www.mikedeboer.nl/?p=25</guid>
		<description><![CDATA[Today I came across the most interesting announcement from Mozilla&#8217;s Aza Raskin: Ubiquity 0.1 alpha is out. That means I have a new toy to play with!
Ubiquity is an add-on for the Firefox browser that enables the user to interact with content like never before; contextual fragments of a webpage can be translated, sent by [...]]]></description>
			<content:encoded><![CDATA[<p>Today I came across the most interesting <a title="Ubiquity release announcement" href="http://labs.mozilla.com/2008/08/introducing-ubiquity/" target="_blank">announcement</a> from Mozilla&#8217;s <a title="Raskin's blog" href="http://www.azarask.in/blog/" target="_blank">Aza Raskin</a>: Ubiquity 0.1 alpha is out. That means I have a new toy to play with!</p>
<p>Ubiquity is an add-on for the Firefox browser that enables the user to interact with content like never before; contextual fragments of a webpage can be translated, sent by email, looked up with Google Maps, searched with by wikipedia, youtube, flickr and so much more. I suggest you watch the <a title="Video from Vimeo" href="http://www.vimeo.com/1561578" target="_blank">video</a>!</p>
<p>As with every other new toy, I started playing with it right away and I immediately fell in love with the &#8216;email&#8217; command. I could simply select some text, do ALT+SPACE, type &#8216;email this to ruben&#8217;, hit ENTER and go! It automatically fires up GMail, sets subject, to-address, body text and the only thing left to do is press &#8216;Send&#8217;.<br />
Problem: I do like GMail, but I use it only for emergencies. When ALL my other mailboxes are unavailable, which happens, like&#8230;never. So I rolled <a title="My script repository" href="http://www.mikedeboer.nl/ubiquity" target="_blank">my own little Ubiquity command called &#8216;mail&#8217;</a> that does the exact same thing as &#8216;email&#8217;, but uses the standard &#8216;mailto:&#8217; interface to access your desktop email client.<br />
Problem: it doesn&#8217;t support HTML mail, thus no fancy content like images and hyperlinks. I guess I could add a couple of regular expressions that parse the body text for links and replaces images with BBCode-like placeholders - [img src=http://path.to/image.jpg]. I&#8217;ll do that upon request, ok?</p>
<p>This is only a very simple, first tryout of what I could do with this Ubiquity alpha. There&#8217;s probably more to come, so check up on me regularly when you&#8217;re interested.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikedeboer.nl/2008/08/fun-with-ubiquity/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Gem of the day</title>
		<link>http://www.mikedeboer.nl/2008/08/gem-of-the-day/</link>
		<comments>http://www.mikedeboer.nl/2008/08/gem-of-the-day/#comments</comments>
		<pubDate>Fri, 15 Aug 2008 15:47:50 +0000</pubDate>
		<dc:creator>mikedeboer</dc:creator>
		
		<category><![CDATA[Gems]]></category>

		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.mikedeboer.nl/?p=11</guid>
		<description><![CDATA[It&#8217;s not like I&#8217;m going to post a random thing I found useful as a Gem-of-the-day every day, but let&#8217;s stick with often.
The first gem is this one:

/**
 * Execute a script in the global scope.
 *
 * @param {String} str
 * @type  {String}
 */
jpf.exec = function&#40;str&#41;&#123;
    if &#40;!str&#41; return str;
 [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s not like I&#8217;m going to post a random thing I found useful as a Gem-of-the-day <em>every</em> day, but let&#8217;s stick with <em>often</em>.</p>
<p>The first gem is this one:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">/**
 * Execute a script in the global scope.
 *
 * @param {String} str
 * @type  {String}
 */</span>
jpf.<span style="color: #660066;">exec</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>str<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>str<span style="color: #009900;">&#41;</span> <span style="color: #000066; font-weight: bold;">return</span> str<span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> head<span style="color: #339933;">,</span> script<span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">execScript</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        window.<span style="color: #660066;">execScript</span><span style="color: #009900;">&#40;</span>str<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>head <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;head&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        script <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'script'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        script.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'type'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'text/javascript'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        script.<span style="color: #660066;">text</span> <span style="color: #339933;">=</span> str<span style="color: #339933;">;</span>
        head.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>script<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        head.<span style="color: #660066;">removeChild</span><span style="color: #009900;">&#40;</span>script<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">eval</span><span style="color: #009900;">&#40;</span>str<span style="color: #339933;">,</span> window<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000066; font-weight: bold;">return</span> str<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></div></div>

<p>So what does this little gem do? Well, it provides a developer the power to execute a piece of script - at runtime of course - in the global scope. For example, if your XmlHttpRequest loads the content of a .js script file (e.g. the Content-type header is set to &#8216;text/javascript&#8217;), &#8216;exec()&#8217; will execute that script as if it were loaded with a &lt;script&gt; tag in the &lt;head&gt; section.</p>
<p>Dynamic script loading this feature is called. Wow. Anyway, we use it at Javeline and I found it in the <a title="Mootools website" href="http://mootools.net" target="_blank">Mootools</a> library - lots of cool stuff in there by the way.</p>
<p><strong>Update:</strong> Added the eval fallback with its second argument telling eval to execute the code in the scope of the window object. (<a title="Scary eval" href="http://webreflection.blogspot.com/2008/07/scary-eval-and-futuristic-solution.html">This is supported by Gecko browsers only</a>)<br />
<strong>Update2:</strong> Changed document.head reference to document.getElementsByTagName(&#8221;head&#8221;)[0]. (Thx Mors)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikedeboer.nl/2008/08/gem-of-the-day/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Hello world!</title>
		<link>http://www.mikedeboer.nl/2008/07/hello-world/</link>
		<comments>http://www.mikedeboer.nl/2008/07/hello-world/#comments</comments>
		<pubDate>Mon, 07 Jul 2008 13:45:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.mikedeboer.nl/?p=1</guid>
		<description><![CDATA[Everyone, this really is my first personal blog article ever! Oh well, there&#8217;s a first time for everything, right?
But just like the first I rode a bike, I&#8217;ll probably fall down flat-faced a couple of times over here before I get the hang of it, so please don&#8217;t hold it against me.
The blogging-thing has been [...]]]></description>
			<content:encoded><![CDATA[<p>Everyone, this really is my first personal blog article ever! Oh well, there&#8217;s a first time for everything, right?</p>
<p>But just like the first I rode a bike, I&#8217;ll probably fall down flat-faced a couple of times over here before I get the hang of it, so please don&#8217;t hold it against me.</p>
<p>The blogging-thing has been on my todo-list for a long, long time since I started working at <a title="ebuddy.com website" href="http://www.ebuddy.com" target="_blank">eBuddy.com</a> in 2004. I&#8217;ve experienced a great deal of fun stuff that I would&#8217;ve liked to share at that time, but didn&#8217;t have my domain registration stuff in order. Now I work for <a title="Javeline commercial website" href="http://www.javeline.com" target="_blank">Javeline</a> and they own a web hosting company called HelderHosting! How convenient!</p>
<p>On this blog I will try to bore you with talks about <a title="Wikipedia link" href="http://en.wikipedia.org/wiki/Javascript" target="_blank">Javascript</a> development. Mainly that and a lot of <a title="Wikipedia link" href="http://en.wikipedia.org/wiki/PHP" target="_blank">PHP</a> will sneak in as well. All right, <a title="Wikipedia link" href="http://en.wikipedia.org/wiki/CSS" target="_blank">CSS</a> is also my victim and - oh no, I am going to use the word - Ajax. Yes. The damn word seems to haunt every respectable webdeveloper out there, including poor little me. Of course, I made my own Ajax framework, who hasn&#8217;t these days? My only hope is that the <a title="Wikipedia link" href="http://en.wikipedia.org/wiki/Rich_Internet_application" target="_blank">RIA</a> community will make up their minds really soon, until we end up like having one of the few flaws that PHP seems to suffer from: almost every PHP developer has his own freaking framework! Quite pathetic, really. But they say it&#8217;s their strength, so I let them believe that of course.</p>
<p>Random rants will pass revue as well, as you might&#8217;ve noticed already. However, I&#8217;ll try to keep it organized. Promise. (Hmm, &#8216;organized random rants&#8217;, a contradictio in terminus, isn&#8217;t it?)<br />
I&#8217;d like to save some room for humor as well. And music. And more culture. Oh, heck: just include everything that completes life. My life.</p>
<p>See you around,<br />
Mike.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikedeboer.nl/2008/07/hello-world/feed/</wfw:commentRss>
		</item>
	</channel>
</rss><!-- Dynamic Page Served (once) in 0.505 seconds --><!-- Cached page served by WP-Cache -->
