<?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>MIH SWAT &#187; ajax</title>
	<atom:link href="http://www.mihswat.com/tag/ajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mihswat.com</link>
	<description>Headquarters of the Strategic Worldwide Applications and Technologies Team</description>
	<lastBuildDate>Tue, 31 Jan 2012 09:59:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>How did they do that ?</title>
		<link>http://www.mihswat.com/2009/11/16/how-did-they-do-that/</link>
		<comments>http://www.mihswat.com/2009/11/16/how-did-they-do-that/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 12:16:43 +0000</pubDate>
		<dc:creator>Hennie Grobler</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[ui]]></category>

		<guid isPermaLink="false">http://www.mihswat.com/?p=913</guid>
		<description><![CDATA[Have you ever come across a website and saw some really interesting aspects of the user interface ? Maybe it was a site design that looks like a flash site but was not? Or maybe you came across a site &#8230; <a href="http://www.mihswat.com/2009/11/16/how-did-they-do-that/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-914" src="http://www.mihswat.com/wp-content/uploads/2009/10/FacebookHideSample.bmp" alt="Sample Image" width="381" height="51" /></p>
<p>Have you ever come across a website and saw some really interesting aspects of the user interface ? Maybe it was a site design that looks like a flash site but was not? Or maybe you came across a site that had a visually appealing menu.<span id="more-913"></span></p>
<p>Coming from mostly a backend-development background I get this feeling often. Last week it happened when I saw the Hide option on Facebook. I have seen it a hundred times before but on that day I found myself wondering, so I recreated the sample in my own way from scratch.</p>
<p>The following questions came to mind while looking at Facebook’s implementation:</p>
<ol>
<li>how to make the hide option, appear next to feed item that the mouse is hovering over.</li>
<li>how to make the ‘menu’ item under the hide option appear and stay there when the Hide button is clicked</li>
<li>how to remove the selected options from the list without having to refresh the whole page</li>
<li>how to send the filter option to the server without posting back the whole page</li>
</ol>
<p style="padding-top:10px">I decided that I will use styling and jQuery to complete steps 1 – 3 and use a ajax call via jQuery to post the selected filter option back to the server.</p>
<p><strong>Note</strong> that you will need some prior knowledge of jQuery selectors in order to follow the code sample. See the following urls for some background information on this:</p>
<ul>
<li><a href="http://woorkup.com/2009/10/05/jquery-lesson-series-introduction-to-selectors/">http://woorkup.com/2009/10/05/jquery-lesson-series-introduction-to-selectors/</a></li>
<li><a href="http://docs.jquery.com/Selectors">http://docs.jquery.com/Selectors</a></li>
</ul>
<p style="padding-top:10px"><strong><span style="text-decoration: underline">The following are the steps I completed to make these options work:</span></strong></p>
<h4><strong><span style="text-decoration: underline">Create the folder structure:</span></strong></h4>
<p><strong><span style="text-decoration: underline"><img class="alignnone size-full wp-image-918" src="http://www.mihswat.com/wp-content/uploads/2009/10/filestructure.bmp" alt="filestructure" /></span></strong></p>
<ol>
<li>Download the latest query plug-in (jquery.js in the screenshot) from <a href="http://jquery.com/">http://jquery.com/</a></li>
<li>Create your project with necessary files. See the screen shot for my folder structure:</li>
</ol>
<p style="padding-top:10px"><strong><span style="text-decoration: underline">Import the style sheets and javascript files:</span></strong></p>
<p>1. Place the following statements in the index.php file to reference the style sheets and javascript files</p>
<pre>&lt;html&gt;
    &lt;head&gt;
        &lt;title&gt;How did they do that: Facebook Hide&lt;/title&gt;
        &lt;link type="text/css" rel="stylesheet" href="styles/default.css" /&gt;
        &lt;script type="text/javascript" src="js/jquery.js"&gt;&lt;/script&gt;
        &lt;script type="text/javascript" src="js/jquery.feedfilter.js"&gt;&lt;/script&gt;
        &lt;script type="text/javascript" src="js/hidebutton.js"&gt;&lt;/script&gt;
    &lt;/head&gt;
&lt;body&gt;</pre>
<p style="padding-top:10px"><strong><span style="text-decoration: underline">Create the news feed items:</span></strong></p>
<ol>
<li> The sample only shows one of the news feed entries for clarity sake. Repeat item-container div for each additional item you want.</li>
<li>Note the following things when reviewing the snippet
<ol>
<li>The class name for the feed item is <span style="color: #ff00ff">item-container</span>.</li>
<li><span style="color: #ff00ff">Hide-button</span> is a child element of <span style="color: #ff00ff">item-container</span></li>
<li><span style="color: #ff00ff">Hide-menu-header</span> and <span style="color: #ff00ff">hide-button-options</span> are child elements of <span style="color: #ff00ff">hide-button</span>.</li>
<li>The <span style="color: #ff00ff">hide-menu-header</span> relates to the Hide button on the screen shot and <span style="color: #ff00ff">hide-button-options</span> relate to the menu item under that.</li>
<li>The custom <span style="color: #ff00ff">user</span> attribute on the span. This is the id (in our case a fictional id x) of the user&#8217;s events that must be filtered. This is the value that will be posted back to the server during the ajax call.</li>
</ol>
</li>
</ol>
<pre>&lt;body&gt;
    &lt;center&gt;
        &lt;div class="item-container"&gt;
            &lt;div class="left"&gt;
                &lt;div class="left"&gt;
                    &lt;a class="left" href="/profile/sampleprofile"&gt;
                        &lt;img class="profile-pic" src="images/avatar.png" width="55px" height="55px" /&gt;
                    &lt;/a&gt;
                    &lt;div style="clear:both"&gt;&lt;/div&gt;
                &lt;/div&gt;
                &lt;div class="info"&gt;
                    &lt;p&gt;
                        &lt;strong&gt;
                            &lt;a href="/profile/sampleprofile"&gt;Bruce Banner&lt;/a&gt;
                        &lt;/strong&gt; posted on twitter
                    &lt;/p&gt;
                    &lt;div class="detail"&gt;
                        &lt;a href="#"&gt;8 hours ago&lt;/a&gt; | &lt;a href="#"&gt;comment&lt;/a&gt; | &lt;a href="#"&gt;like&lt;/a&gt;
                    &lt;/div&gt;
               &lt;/div&gt;
           &lt;/div&gt;
           &lt;div class="hide-button"&gt;
               &lt;div class="hide-menu-header"&gt;
                   &lt;input type="button" value="hide"/&gt;
               &lt;/div&gt;
               &lt;span class="hide-button-options" user="x"&gt;
                   &lt;input  type="button" value="Bruce Banner" /&gt;
               &lt;/span&gt;
          &lt;/div&gt;
      &lt;/div&gt;
...
&lt;center&gt;
&lt;body&gt;</pre>
<p><strong><span style="text-decoration: underline">Link up all the events to the appropriate elements:</span></strong></p>
<p>Add script to hidebutton.js. The $(document).ready(&#8230;) construct is used to ensure that the initialization is only run once the full DOM is loaded. Note that $(document).ready(&#8230;) will run as soon as index page is loaded because it is imported in index.php and is not wrapped by any functions.</p>
<p>The script calls three methods that in turn use jQuery selectors to find the appropriate elements by class name or id and then links events to them.</p>
<ul>
<li><span style="color: #ff00ff">initializeFeedItemHoverEvent</span><span style="font-family: monospace">: adds the </span><span style="color: #ff00ff">hover </span><span style="font-family: monospace">event to all elements that contain class </span><span style="color: #ff00ff">item-container <span style="color: #000000">(news feed entries)</span></span><span style="font-family: monospace">. There are 2 functions in this method. The first is fired when a mouse cursor is moved over the element and the second is fired when the mouse is moved away from the element</span></li>
<li><span style="color: #ff00ff">initializeHideMenuClick</span><span style="font-family: monospace">: adds a </span><span style="color: #ff00ff">click </span><span style="font-family: monospace">event to all </span><span style="color: #ff00ff">hide-menu-header</span><span style="font-family: monospace"> (hide menu button) items. It uses </span><span style="color: #ff00ff">$(&#8230;).parent</span><span style="font-family: monospace"> and </span><span style="color: #ff00ff">$(&#8230;).find</span><span style="font-family: monospace"> to find the appropriate elements relative to the current element. </span><span style="color: #ff00ff">$(this)</span><span style="font-family: monospace"> in this method relates to the hide menu button. It also uses </span><span style="color: #ff00ff">removeClass</span><span style="font-family: monospace"> and </span><span style="color: #ff00ff">addClass</span><span style="font-family: monospace"> to toggle the selected and unselected appearance of the hide menu button.</span></li>
<li><span style="color: #ff00ff">initializeHideSubMenuClick</span><span style="font-family: monospace">: Calls the </span><span style="color: #ff00ff">feedfilter</span><span style="font-family: monospace">() method (explained in the next step) on the appropriate hide button sub menu element. The feedfilter() method will use ajax to post the filter back to the server.</span></li>
</ul>
<p style="padding-top:10px">
<pre>//file: hidebutton.js
$(document).ready(function() {
    initializeFeedItemHoverEvent();
    initializeHideMenuClick();
    initializeHideSubMenuClick();
});

//Initialise the hover events over the newsfeed entries function initializeFeedItemHoverEvent(){
//Find all newsfeed items that have a class called item-container
$('.item-container').hover(function() {
        //Show the hide button when the mouse moves onto the item
        $(this).find('.hide-button').show();
    },
    function() {
        //When the mouse cursor leaves the newsfeed item,
        //hide the hide button and reset the styling to original
        var hideButton = $(this).find('.hide-button');
        hideButton.hide();
        resetStyles(hideButton);
        //Hide the submenu of the hide button
        $(this).find('.hide-button-options').hide();
    })
}

//Initialise the click on the hide menu item
function initializeHideMenuClick(){
    //Find the hide button the user clicked and toggle (show/ hide) submenu
    $('.hide-menu-header').click(function() {
        //Find parent with class 'hide-button' of the current element
        //from there find the child of the found element called 'hide-button-options'
        var element = $(this).parent('.hide-button').find('.hide-button-options');

        //Find out which class is set on the current element
        //and based on that set a different class
        if ($(this).attr('class') == 'hide-menu-header'){
            $(this).removeClass('hide-menu-header');
            $(this).addClass('hide-menu-header-selected');
            element.show();
        }
        else {
            $(this).removeClass('hide-menu-header-selected');
            $(this).addClass('hide-menu-header');
            element.hide();
        }
    })
}

//Initialise the click event on the hide sub menu
function initializeHideSubMenuClick(){
    //When the user clicks on the menu option then
    //call the feedfilter method in the  jquery.feedfilter.js file
    if ($(".hide-button-options").length &gt; 0) {
        $(".hide-button-options").feedfilter();
    }
}

//Hide the menu button and its sub menus
function resetStyles(hideButton){
    var menuHeader = hideButton.find(".hide-menu-header-selected");
    if (menuHeader != null){
        menuHeader.removeClass('hide-menu-header-selected');
        menuHeader.addClass('hide-menu-header');
    }
}</pre>
<p><span style="text-decoration: underline"><strong>Complete the server post back:</strong></span><br />
The following section describes the code that fires when a user clicks on the hide button sub menu option. It first extracts the user id that is stored in the custom <span style="color: #ff00ff">user </span>attribute and posts it back to the specified page.</p>
<p>Note the <span style="color: #ff00ff">if (response == &#8220;success&#8221;) {..}</span> section. It finds all the news feed items with a sub element that has a <span style="color: #ff00ff">user </span>attribute with the same value as the news feed item that the user chose to hide.</p>
<p><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace;line-height: 18px;font-size: 12px">//jquery.feedfilter.js</span></p>
<pre>//Specifiy the feedfilter function definition
//What must happen when the user clicks the sub menu item
(function($) {
	$.fn.feedfilter = function() {

		this.click(function() {
			//Call setFeedfilter
            setFeedfilter($(this));
			return false;
		})

		function setFeedfilter(obj) {

            //Get the value of the user attribute on the current element
            //as the user clicked on the hide sub menu the current element is
            //the hide sub menu
            var user = obj.attr("user");
            var container = obj;
            var originalContent = container.html();

			$.ajax({
		    	type: "POST", //post back method
		    	url: "ajaxpostback.php", //page to post back to
		    	dataType: "json",
		    	data: {"userId": user}, //additional parameters
		    	beforeSend: function(xmlhttprequest) {
                                //change the content of the sub menu button to appear as a
                                //loading animated gif
		    		container.html('&lt;img src="\" alt="\"loading\"" /&gt;')
		    	},
		    	complete: function(xmlhttprequest, textStatus) {
                               //add any code here that should fire once the post back
                               //is completed
		    	},
		    	success: function(response) {
                               //add any code that must run once the postback is completed and
                               //successfull
		    		if (response == "success") {
                        $(".item-container .hide-button-options").each( function() {
                               var data = $(this).attr("user");
                               if (user == data)
                               {
                                   $(this).parent('div').parent('.item-container').hide();
                               }
                            }
                        );
		    		}
                    else
                    {
		    			alert(response);
		    		}
		    	},
		    	error: function(xmlhttprequest,status,error) {
		    		alert("There was a problem with filtering events.");
                    container.html(originalContent);
                    }
		    })
		}
	}
})(jQuery)</pre>
<p style="padding-top:10px"><strong><span style="text-decoration: underline">What happens on the post back page?</span></strong></p>
<p>I have not implemented the actual persisting of the filter setting but have shown how to retrieve the parameter value passed from the client side.</p>
<pre>&lt;?php
    //Persist $_POST["userId"];
    echo json_encode(array("success"));
?&gt;</pre>
<p style="padding-top:10px"><span style="text-decoration: underline"><strong>View the result</strong></span></p>
<p style="padding-top:10px">Browse to the index.php page and you should get something similar to the screenshot shown below.</p>
<p><img class="alignnone size-full wp-image-967" src="http://www.mihswat.com/wp-content/uploads/2009/10/result.bmp" alt="Code Sample Result" /></p>
<p style="padding-top:10px"><strong><span style="text-decoration: underline">What&#8217;s next?</span></strong></p>
<ul>
<li>Styling can be refined. I used some inline styles etc that can be moved to the style sheets.</li>
<li>Content is static at the moment. The news feed items would normally be generated from a data store of some sort</li>
<li>Add additional error handling</li>
<li>I used inline php and markup together to simplify the example. Best practice though, is to split your php code and markup. One approach would be to implement the Model View Controler (MVC) design pattern. A good option for this is to use the Zend Framework (<a href="http://framework.zend.com/">http://framework.zend.com/</a>). It implements the MVC pattern and has loads wrapper classes that wraps commonly used functionality to promote reuse.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.mihswat.com/2009/11/16/how-did-they-do-that/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vacancies at SWAT</title>
		<link>http://www.mihswat.com/2009/11/03/vacancies-at-swat/</link>
		<comments>http://www.mihswat.com/2009/11/03/vacancies-at-swat/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 11:27:04 +0000</pubDate>
		<dc:creator>Jacques van Niekerk</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Graphic Design / UX]]></category>
		<category><![CDATA[Semantic Web]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[architects]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[developers]]></category>
		<category><![CDATA[digital TV]]></category>
		<category><![CDATA[geeks]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[iptv]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[microsoft .net]]></category>
		<category><![CDATA[oo]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[sao paulo]]></category>
		<category><![CDATA[soap]]></category>
		<category><![CDATA[social graph]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[uml]]></category>
		<category><![CDATA[vod]]></category>
		<category><![CDATA[web 2.0]]></category>
		<category><![CDATA[zend framework]]></category>

		<guid isPermaLink="false">http://www.mihswat.com/?p=977</guid>
		<description><![CDATA[Would you like to work at SWAT ? We have a few positions vacant at the moment &#8211; have a look: In Sao Paulo, Brazil &#8211; we need a junior front-end developer. You are highly skilled in front-end development, with &#8230; <a href="http://www.mihswat.com/2009/11/03/vacancies-at-swat/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Would you like to work at SWAT ?<span id="more-977"></span></p>
<p>We have a few positions vacant at the moment &#8211; have a look:</p>
<p>In Sao Paulo, Brazil &#8211; we need a<strong> junior front-end developer</strong>. You are highly skilled in front-end development, with specific skills in CSS, HTML and Javascript. You are a competent programmer, but you prefer to work on the front-end. You will be working under the guidance of an experienced and expert engineer.  You like working with bright and clever people, and you are passionate about the web. The successful candidate will speak English, and will be a paulistano, or be willing to relocate to Sao Paulo.</p>
<p>In Johannesburg &#8211; we are looking for a <strong>senior technical architect</strong>. You will have the opportunity to establish the blueprint and create the framework for truly cutting edge media delivery platforms that will change the face of media in South Africa. And that is no exaggeration. You should have outstanding technical skills, including the ability to code as and when required. You must be able to interact with a team of highly skilled professionals. You will ideally have experience of VOD, digital TV, IP-TV and related technologies. A background as a developer is essential &#8211; you will have in-depth knowledge of the Microsoft .Net platform, but also wider knowledge of open source platforms and languages. You are comfortable dealing with executives and senior managers. You&#8217;re not only an ubergeek, but also an inspirational tech leader. This is a challenging position &#8211; but it represents a massive opportunity to the right person. Detailed requirements <a href="http://www.mihswat.com/wp-content/uploads/2009/11/Lead-Architect1.pdf">here.</a></p>
<p>In Cape Town &#8211; we are looking for a <strong>junior tester</strong>, who will devote a great deal of time to ensuring that a large corporate social network meets the right quality standards. You will be part of the SWAT core team &#8211; you must be prepared to work with some of the best developers, architects, geeks and web-heads you are ever likely to meet. Can you execute tasks on your own initiative, prepare and execute test plans ? More details on the position can be found <a href="http://www.mihswat.com/wp-content/uploads/2009/11/Junior-Tester.pdf">here. </a></p>
<p>Cape Town &#8211; we are looking for someone to play the role of <strong>Internet Evangelist</strong>. This role is available to anyone who is absolutely passionate about the web, who is capable of conveying this passion to diverse audiences, who learns quickly &#8230; and who can teach others. Your role will be to evangelise the use of Web technologies (and other Internet related technologies) into the larger group &#8211; the challenge is to make people from all non-internet businesses see the Internet as an opportunity not a threat. In addition you will perform tasks as assistant community manager for the corporate social network, and you will assist the Analyst in the team with research tasks. You must be willing to travel in South Africa and abroad, as required. To apply for this job, you will have to demonstrate passion, interest and knowledge of the Web and related technologies. You are a well-spoken, confident geek, web-head and proud to be a Web addict. </p>
<p>Finally, and also in Cape Town &#8211; we want to recruit a <strong>PHP developer</strong>. You will be have outstanding technical skills, wide experience in web based development, and you will be able to hold your own amongst an elite group of developers and architects. Javascript, Zend Framework, AJAX, OO, Web 2.0, REST, SOAP and UML will be old news to you. You are passionate about the web. If you think Twitter is silly, you don&#8217;t need to apply. More information <a href="http://www.mihswat.com/wp-content/uploads/2009/11/PHP-Developer1.pdf">here.</a></p>
<p>If you are interested in any of these positions, please send your CV to <a href="mailto:mkoch@mihinternet.com">Melanie Koch</a>. We look forward to hearing from you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mihswat.com/2009/11/03/vacancies-at-swat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The State of Javascript</title>
		<link>http://www.mihswat.com/2009/11/02/the-state-of-javascript/</link>
		<comments>http://www.mihswat.com/2009/11/02/the-state-of-javascript/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 18:16:41 +0000</pubDate>
		<dc:creator>Dani Valentin</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.mihswat.com/?p=980</guid>
		<description><![CDATA[Douglas Crockford wrote in a 2001 article that javascript was the world&#8217;s most misunderstood programming language. In another article, from 2008, he explains why: &#8220;Its obvious defects, its unfashionable programming model, intentional mispositioning at its introduction, and its ridiculous name &#8230; <a href="http://www.mihswat.com/2009/11/02/the-state-of-javascript/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.crockford.com">Douglas Crockford</a> wrote in a 2001 <a href="http://www.crockford.com/javascript/javascript.html">article</a> that javascript was the world&#8217;s most misunderstood programming language. In another <a href="http://javascript.crockford.com/popular.html">article</a>, from 2008, he explains why: &#8220;Its obvious    defects, its unfashionable programming model, intentional mispositioning    at its introduction, and its ridiculous name caused it to be rejected    as unworthy by most knowledgeable programmers&#8221;. And then, he recognizes: there was AJAX. And AJAX gave javascript a second chance.<span id="more-980"></span></p>
<p>In another <a href="http://ejohn.org/blog/javascript-as-a-language/">place</a>, I read about the phases javascript&#8217;s been through since its creation:</p>
<ul>
<li>The &#8220;We need scripting for web pages&#8221; phase. (Netscape)</li>
<li>The &#8220;We should standardize this&#8221; phase. (ECMAScript)</li>
<li>The &#8220;Javascript is not a toy&#8221; phase. (Ajax)</li>
</ul>
<p>And now we are in a new phase: <strong>Javascript is a programming language phase</strong>. And, even though it is currently the world&#8217;s most popular programming language, there are still a lot of confusion about its current state, lack of knowledge of its power and outdated information about it. This article tries to throw some light at it.</p>
<h3>First, <strong>a little bit of history</strong></h3>
<p>Javascript was introduced in December 1995 by Netscape. It was developed by <a href="http://weblogs.mozillazine.org/roadmap/">Brendan Eich</a> and was called Mocha and LiveScript before. According to Brendan himself, the confusing name was given when Netscape and Sun did a license agreement and wanted to make javascript complementary scripting language to go with Java. Others believe that the name was given so it could  ride along in Java marketing, since this was the hot programming language of that time.</p>
<p>In the beginning, the language targeted non-tech people, specially designers and amateurs and the main idea was to add some interation to web pages. That is why the language is so flexible: it was supposed to make programming easy for beginners.</p>
<h3>ECMA and standardization</h3>
<p>After it was launched, Microsoft, interested in getting some of Netscape&#8217;s users for itself , developed a compactible dialect to the language. It was called JScript, as Javascript is a trademark of Sun Microsystems, and was included in Internet Explorer 3. Because of the emerging different implementations, people realized the importance to standardize it.</p>
<p>This job was given to <a href="http://www.ecma-international.org/">ECMA</a> that wrote a document decribing how the language should work. The language described in this document, the ECMA-262 specification, is called ECMAScript. Other programming languages are based in ECMAScript, like ActionScript.</p>
<p>We are currently in edition 3 (Javascript 1.5 &#8211; published in 1999). The forth edition of ECMA-262 (Javascript 2.0) was supposed to be finished in October 2008. Along with the critics it received, the most important were:</p>
<ul>
<li>The language didn&#8217;t need that much change</li>
<li>Javascript didn&#8217;t need to look like Java or any other language</li>
<li>Javascript already does well what it proposes to do</li>
<li>Javascript did not need a better extension mechanism</li>
</ul>
<p>Because of differences between gigantics &#8211; in one side: Google, Mozilla and Adobe (that supported version 4); on the other: Microsoft (that was working in a softer version, 3.1), this edition was suspended and a new mid-term edition was created: ECMAScript Harmony. (more <a href="https://mail.mozilla.org/pipermail/es-discuss/2008-August/003400.html">here</a> and <a href="http://en.wikipedia.org/wiki/ECMAScript#ECMAScript_Harmony">here</a>).</p>
<h3>Javascript versions and browsers</h3>
<p>Javascript is currently in version 1.8.1. That doesn&#8217;t mean all browsers run the latest version or even the same one. The table bellow shows each browser and its respective javascript version.</p>
<table class="wikitable" style="font-size: smaller; text-align: center; border: 1px solid #000">
<tbody>
<tr>
<th style="border: 1px solid #000">Version</th>
<th style="border: 1px solid #000">Release date</th>
<th style="border: 1px solid #000">Equivalent to</th>
<th style="border: 1px solid #000">Netscape<br />
Navigator</th>
<th style="border: 1px solid #000">Mozilla<br />
Firefox</th>
<th style="border: 1px solid #000">Internet<br />
Explorer</th>
<th style="border: 1px solid #000">Opera</th>
<th style="border: 1px solid #000">Safari</th>
<th style="border: 1px solid #000">Google<br />
Chrome</th>
</tr>
<tr>
<td style="border: 1px solid #000">1.0</td>
<td style="border: 1px solid #000">March 1996</td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000">2.0</td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000">3.0</td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000"></td>
</tr>
<tr>
<td style="border: 1px solid #000">1.1</td>
<td style="border: 1px solid #000">August 1996</td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000">3.0</td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000"></td>
</tr>
<tr>
<td style="border: 1px solid #000">1.2</td>
<td style="border: 1px solid #000">June 1997</td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000">4.0-4.05</td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000"></td>
</tr>
<tr>
<td style="border: 1px solid #000">1.3</td>
<td style="border: 1px solid #000">October 1998</td>
<td style="border: 1px solid #000">ECMA-262 1<sup>st</sup> edition / ECMA-262 2<sup>nd</sup> edition</td>
<td style="border: 1px solid #000">4.06-4.7x</td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000">4.0</td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000"></td>
</tr>
<tr>
<td style="border: 1px solid #000">1.4</td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000">Netscape<br />
Server</td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000"></td>
</tr>
<tr>
<td style="border: 1px solid #000">1.5</td>
<td style="border: 1px solid #000">November 2000</td>
<td style="border: 1px solid #000">ECMA-262 3<sup>rd</sup> edition</td>
<td style="border: 1px solid #000">6.0</td>
<td style="border: 1px solid #000">1.0</td>
<td style="border: 1px solid #000">5.5 (JScript 5.5),<br />
6 (JScript 5.6),<br />
7 (JScript 5.7),<br />
8 (JScript 6)</td>
<td style="border: 1px solid #000">6.0,<br />
7.0,<br />
8.0,<br />
9.0</td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000"></td>
</tr>
<tr>
<td style="border: 1px solid #000">1.6</td>
<td style="border: 1px solid #000">November 2005</td>
<td style="border: 1px solid #000">1.5 + Array extras + Array and String generics + E4X</td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000">1.5</td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000">3.0, 3.1</td>
<td style="border: 1px solid #000"></td>
</tr>
<tr>
<td style="border: 1px solid #000">1.7</td>
<td style="border: 1px solid #000">October 2006</td>
<td style="border: 1px solid #000">1.6 + Pythonic generators + Iterators + let</td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000">2.0</td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000">3.2, 4.0</td>
<td style="border: 1px solid #000">1.0</td>
</tr>
<tr>
<td style="border: 1px solid #000">1.8</td>
<td style="border: 1px solid #000">June 2008</td>
<td style="border: 1px solid #000">1.7 + Generator expressions + Expression closures</td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000">3.0</td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000"></td>
</tr>
<tr>
<td style="border: 1px solid #000">1.8.1</td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000">1.8 + Minor Updates</td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000">3.5</td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000"></td>
</tr>
<tr>
<td style="border: 1px solid #000">1.9</td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000">1.8.1 + <a title="ECMAScript" href="http://en.wikipedia.org/wiki/ECMAScript">ECMAScript</a> 5 Compliance</td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000">4</td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000"></td>
<td style="border: 1px solid #000"></td>
</tr>
</tbody>
</table>
<h3>Javascript Engines</h3>
<p>Since last year, browsers have been fighting on which one has the best Javascript performance in the so-called Second Browser War. It all began with Google Chrome and its engine, <a href="http://code.google.com/p/v8/">V8</a>. Then, Safari launched its SquirrelFish that evolved 3 months later to <a href="http://webkit.org/blog/214/introducing-squirrelfish-extreme/">SquirrelFish Extreme</a>. In june 2009, Mozilla released its Firefox 3.5 with an optimized <a href="http://www.mozilla.org/js/spidermonkey/">SpiderMonkey</a> engine, called now TraceMonkey, that boosted its speed to 40 times in some cases.</p>
<p><a href="http://lifehacker.com">Lifehacker</a> did some speed tests last june with the final versions of Safari (4.0), Chrome (2.0) and Internet Explorer (8) and almost-there betas of Firefox (3.5b99) and Opera (10b1). The results can be seen <a href="http://lifehacker.com/5286869/lifehacker-speed-tests-safari-4-chrome-2-and-more">here</a>.</p>
<h3>Other Javascript uses and projects</h3>
<p>It is worth remembering other uses of javascript, besides in a webpage. First of all, we can use it for:</p>
<ul>
<li><a href="http://www.adobe.com/products/air/develop/ajax/">build an Adobe Air application</a></li>
<li><a href="http://developer.apple.com/macosx/dashboard.html">develop Apple&#8217;s Dashboard Widgets</a></li>
<li><a href="https://developer.mozilla.org/en/Building_an_Extension">create an extension for Firefox</a></li>
</ul>
<p>We can also mention other interesting projects:</p>
<ul>
<li><a href="http://www.mozilla.org/rhino/">Rhino</a> is an implementation of Javascript 1.7 written in Java by Mozilla. Running on it, you have a lot of <a href="http://en.wikipedia.org/wiki/Server-side_JavaScript">Javascript server-side projects</a></li>
<li><a href="http://www.iunknown.com/2007/06/steve-yegge-por.html">Javascript on Rails</a>: this is a 2007 project, developed by <a href="http://steve-yegge.blogspot.com/">Steve Yegge</a>, that ports Ruby on Rails to Javascript. Steve did this because he wanted something like RoR to work on projects in Google but this was not an allowed programming language in the enterprise. It also runs on top of Rhino.</li>
<li><a href="https://wiki.mozilla.org/Tamarin:ScreamingMonkey">ScreamingMonkey</a>: another Mozilla project, its goal is to allow <a href="http://www.mozilla.org/projects/tamarin/">Tamarin</a> to run within non-Mozilla browsers, starting with Internet Explorer, allowing them to understand Javascript 2 even though not implemented</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.mihswat.com/2009/11/02/the-state-of-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

