<?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>WiseCodes &#187; JAVASCRIPT</title>
	<atom:link href="http://www.wisecodes.com/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wisecodes.com</link>
	<description>Bringing You The Power of Code !!</description>
	<lastBuildDate>Wed, 01 Sep 2010 19:33:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Javascript scalable applications</title>
		<link>http://www.wisecodes.com/2009/10/javascript-scalable-applications/</link>
		<comments>http://www.wisecodes.com/2009/10/javascript-scalable-applications/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 18:43:05 +0000</pubDate>
		<dc:creator>Venu Thomas</dc:creator>
				<category><![CDATA[JAVASCRIPT]]></category>

		<guid isPermaLink="false">http://www.wisecodes.com/?p=919</guid>
		<description><![CDATA[Today I was flipping through reading one of the presentations by Nicholas Zakas, specifically the &#8220;Scalable Javascript Applications Architecture&#8220;.  Although not the first thing I read on the subject, I enjoyed the clarity with which Nicholas explains. I will try to record the impressions taken in case anyone can help. 1) Theory of modules The [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was flipping through reading one of <strong><a href="http://www.slideshare.net/nzakas" target="_blank">the presentations</a></strong> by <strong><a href="http://www.nczonline.net/" target="_blank">Nicholas Zakas</a></strong>, specifically the &#8220;<strong><a href="http://www.slideshare.net/nzakas/scalable-javascript-application-architecture" target="_blank">Scalable Javascript Applications Architecture</a></strong>&#8220;.  Although not the first thing I read on the subject, I enjoyed the clarity with which Nicholas explains. I will try to record the impressions taken in case anyone can help.</p>
<h2>1) Theory of modules</h2>
<p>The theory of modules (as Nicholas calls it) tells us that one way to create an application that is scalable and easy to maintain, this should be composed of modules.</p>
<h3><strong>What are modules?</strong></h3>
<p>A module (in our terms) is one application that is part of a larger structure. Each has a job and only takes care of it.</p>
<p style="text-align: center;"><a rel="attachment wp-att-920" href="http://www.wisecodes.com/2009/10/javascript-scalable-applications/javascriptscalableapplications/"><img class="aligncenter size-medium wp-image-920" title="JavascriptScalableApplications" src="http://www.wisecodes.com/wp-content/uploads/2009/10/JavascriptScalableApplications-300x229.jpg" alt="JavascriptScalableApplications" width="300" height="229" /></a><br />
(<em><a href="http://www.wisecodes.com/wp-content/uploads/2009/10/JavascriptScalableApplications.jpg">See Picture</a></em>)<br />
(I enjoyed this picture gives a clear picture of the meaning of magnitude).</p>
<p><strong>Code</strong></p>
<pre class="brush: jscript;">
Core.register(&amp;quot;hello-world&amp;quot;, function(sandbox){
 // Private Variables
 var strPriv = &amp;quot;Private&amp;quot;;

 //  Public Methods
 return {
   init: function(){
     try{
      sandbox.console(&amp;quot;start the module&amp;quot;);
     } catch(ex) {
      alert(&amp;quot;sandbox not found&amp;quot;);
     }
   },
   destroy: function(){
    // Destructor
   }
 };
});
</pre>
<p>Here&#8217;s an example of a module that recorded with <em><span style="color: #993300;">Core.register()</span></em> we will see later.<br />
Looking at the form we see that the first parameter informs the module name and the second specifies the functionality of the module. This function receives as parameter <em><span style="color: #993300;">sandbox</span></em> (Also see below).<br />
This feature will return an object with at least two methods <em><span style="color: #993300;">init()</span></em> and <em><span style="color: #993300;">destroy()</span></em> that comprise the options available in the module.<br />
<em><span style="color: #993300;"> init()</span></em> will be treated as the builder of the module and will be executed when the module is generated. On the other hand <em><span style="color: #993300;">destroy()</span></em> will be treated as the destroyer of the module running when the module is removed.</p>
<h2>Sandbox</h2>
<p>In software development environment called the Sandbox to test isolated where the experts on running applications. In this case, practically based on the same and that each of the modules used an isolated environment for other modules.<br />
Code</p>
<pre class="brush: jscript;">
var Sandbox = function() {
   var strPrivate = &amp;quot;Private&amp;quot;;

   return {
     alert: function(str){
       alert(str + strPrivate);
     },
     console: function(str) {
       console.log(str);
     }
 }
};
</pre>
<p>As we see the Sandbox, this is an element that offers a number of ways in which we interact with the application. For example, could be used to interact with the DOM of the application using a JS framework (or not) could implement a simple version and checked to make Ajax requests or validate forms, &#8230;. All this is available from the modules.<br />
This module should only worry about what the Sandbox allowed without worrying about what lies beneath it, thus facilitating the development and functionality of each module.<br />
<strong> Example:</strong></p>
<pre class="brush: jscript;">
// Add method notify () to Sandbox
var Sandbox = function() {
  ....
   notify: function(opt){
     // Checks prior
     // .....
     $(&amp;quot;#notify #title&amp;quot;).text(opt.title);
     $(&amp;quot;#notify #content&amp;quot;).html(opt.content);
   }
  ....
};

// Use the method notify () of the Sandbox from the module.
Core.register(&amp;quot;hello-world&amp;quot;, function(sandbox){
   // Private Variables
   ver ver = &amp;quot;1.0&amp;quot;;

   return {
    init: function(){
      try{
        sandbox.notify({
          title: &amp;quot;Hello World v.&amp;quot; + ver,
          content: 'This is a &amp;lt;strong&amp;gt;Test&amp;lt;/strong&amp;gt;.&amp;lt;br /&amp;gt;To demonstrate the use of modules'
        });
      } catch(ex) {
        alert(&amp;quot;sandbox not found&amp;quot;);
      }
    },
    destroy: function(){
     // Destructor
     }
   };
});
</pre>
<p>In the example we see that at the start of our module, we call the method <em><span style="color: #993300;">notify()</span></em> from sandbox without worrying about what will make this method.<br />
The method after a series of previous validations, simply add a title and content to an element <em><span style="color: #993300;">#notify</span></em> using jQuery.<br />
Thus, the Sandbox filter made between the module and the framework controlling what this intends to do about our application.</p>
<h2>The Core</h2>
<p>In the above we have seen a variable Core that seems to be the cornerstone of all this. This is a small script that allows modules to register and associate a new instance of the SandBox to each of them every time you run .</p>
<pre class="brush: jscript;">
var Core = function(){
   // Private Variable
   var modules = {};

   // Instance Creams
   function createInstance(moduleID){
    var instance = modules[moduleID].creator(new Sandbox(this)),
    name, method;

    if (!debug) {
      for (name in instance){
        method = instance[name];
        if (typeof method == &amp;quot;function&amp;quot;) {
          instance[name] = function(name, method) {
            return function(){
              try { return method.apply(this, arguments);    }
              catch(ex) { log(1, name + &amp;quot;(): &amp;quot; + ex.message);    }
            }
          }
        }
      }
    }
  return instance;
 }

 //  Public method
 return {
   register: function(moduleID, creator) {
     modules[moduleID] = {
       creator: creator,
       instance: null
     };
   },
   start: function(moduleID) {
     modules[moduleID].instance = createInstance(moduleID);
     modules[moduleID].instance.init();
   },
   stop: function(moduleID){
     var data = modules[moduleID];
     if (data.instance) {
       data.instance.destroy();
       data.instance = null;
     }
   },
   startAll: function(){
     for (var moduleID in modules) {
       if (modules.hasOwnProperty(moduleID)) {
         this.start(moduleID);
       }
     }
   },
   stopAll: function() {
     for (var moduleID in modules) {
       if (modules.hasOwnProperty(moduleID)) {
         this.stop(moduleID);
       }
     }
   }
 };
}();
</pre>
<p>As we see it is a small script (this is a base, can be extended depending on the needs of the project) that allows us to build the modules we want for every application.<br />
<strong> Example</strong></p>
<pre class="brush: jscript;">
Core.register(&amp;quot;....&amp;quot;, function(sandbox){});
Core.register(&amp;quot;....&amp;quot;, function(sandbox){});
Core.register(&amp;quot;....&amp;quot;, function(sandbox){});
Core.register(&amp;quot;....&amp;quot;, function(sandbox){});
...

// Start all modules
Core.startAll();
</pre>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.wisecodes.com/2009/10/javascript-scalable-applications/" target="_blank"><img src="http://www.wisecodes.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.wisecodes.com/2009/10/javascript-scalable-applications/" target="_blank" title="Share on Facebook">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.wisecodes.com/2009/10/javascript-scalable-applications/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Let Google host your javascript libraries</title>
		<link>http://www.wisecodes.com/2009/09/let-google-host-your-javascript-libraries/</link>
		<comments>http://www.wisecodes.com/2009/09/let-google-host-your-javascript-libraries/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 14:38:29 +0000</pubDate>
		<dc:creator>Venu Thomas</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[JAVASCRIPT]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://www.wisecodes.com/?p=887</guid>
		<description><![CDATA[An interesting possibility offered by Google developers use it as a CDN (content distribution network) for open source javascript libraries popular. In practice, this means is that in your web development, instead of going to your server for libraries that use scripting, you can directly reference and use the possibilities offered by this company in [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a rel="attachment wp-att-888" href="http://www.wisecodes.com/2009/09/let-google-host-your-javascript-libraries/googlecode/"><img class="size-full wp-image-888 aligncenter" title="GoogleCode" src="http://www.wisecodes.com/wp-content/uploads/2009/09/GoogleCode.jpg" alt="GoogleCode" width="161" height="40" /></a></p>
<p>An interesting possibility offered by Google developers use it as a CDN (content distribution network) for open source javascript libraries popular. In practice, this means is that in your web development, instead of going to your server for libraries that use scripting, you can directly reference and use the possibilities offered by this company in its servers.</p>
<p>This provides several advantages are not insignificant:</p>
<ul>
<li>First, the discharge of these libraries will, for the client, probably faster than if you have to get from your server through the Internet. This is Google&#8217;s network infrastructure, and that means guarantees.</li>
<li>Second, and related to the above, if this is a high traffic website, the audience will surely be allowed infinitely greater than you can offer to another server.</li>
<li>Third, if the user has previously visited another site that also use the same library, will benefit from the local cache of the same, because your browser does not again discharged. And in any case, they would be taking advantage of Google&#8217;s cache optimizations.</li>
<li>fourth, do not consume bandwidth from your provider, although this is negligible. And I mean negligible bandwidth, not the provider <img src='http://www.wisecodes.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </li>
<li>fifth, you can use the libraries from sites hosted somewhere where you could not, or is not easy, upload scripts, as the platform <strong><a href="http://www.blogger.com/" target="_blank">Blogger</a></strong> from which to write.</li>
</ul>
<p>At this point includes: development frameworks, in all versions available:</p>
<ul>
<li>jQuery</li>
<li>jQuery UI</li>
<li>Prototype</li>
<li>script_aculo_us</li>
<li>MooTools</li>
<li>Dojo</li>
<li>SWFObject</li>
<li>Yahoo! User Interface Library (YUI)</li>
</ul>
<p>If you&#8217;re already using Google Ajax libraries (such as the Visualization API, or Google Maps), and get through the charger google.load (), you can also use it to download these frameworks. You can also do so through a direct reference, such as:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p887code2'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p8872"><td class="code" id="p887code2"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script 
src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.2/prototype.js&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Oh, and not worry about changing versions, or anything. Google is committed to live indefinitely all distributions to be published and include updates as they appear.</p>
<p>Finally, and to provide a negative view, some people think that this is one more strategy for Google to get information about users&#8217; browsing, code execution from its servers enable cookies and reading of data that could be used for purposes other than those provided on your website. Still others think it could be a source for the spread of malicious code if someone managed to hack these archives. Obviously not a good idea to use this option if you go to work in local mode, offline.</p>
<p>For more information on how to download and libraries available, you can visit the Developer Guide for <strong><a href="http://code.google.com/intl/en/apis/ajaxlibs/documentation/index.html" target="_blank">Ajax libraries API.</a></strong></p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.wisecodes.com/2009/09/let-google-host-your-javascript-libraries/" target="_blank"><img src="http://www.wisecodes.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.wisecodes.com/2009/09/let-google-host-your-javascript-libraries/" target="_blank" title="Share on Facebook">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.wisecodes.com/2009/09/let-google-host-your-javascript-libraries/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>5 ways to use Ajax with jQuery</title>
		<link>http://www.wisecodes.com/2009/08/5-ways-to-use-ajax-with-jquery/</link>
		<comments>http://www.wisecodes.com/2009/08/5-ways-to-use-ajax-with-jquery/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 05:35:43 +0000</pubDate>
		<dc:creator>Venu Thomas</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[JAVASCRIPT]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Learn]]></category>
		<category><![CDATA[OpenSource]]></category>

		<guid isPermaLink="false">http://www.wisecodes.com/?p=804</guid>
		<description><![CDATA[The people of Nettuts publishes an interesting article on using  jQuery with Ajax. Specifically the 5 ways that jQuery allows us to send asynchronous requests. $.load() $.get() $.post() $.getJSON() $.getScript() $. load () This is the feature I like most about jQuery already makes one of the most common tasks of developing with Ajax is [...]]]></description>
			<content:encoded><![CDATA[<p>The people of <strong><a href="http://net.tutsplus.com/tutorials/javascript-ajax/5-ways-to-make-ajax-calls-with-jquery/" target="_blank">Nettuts publishes an interesting article</a></strong> on using  jQuery with Ajax. Specifically <strong><a href="http://docs.jquery.com/Ajax" target="_blank">the 5 ways that </a></strong><strong><a href="http://docs.jquery.com/Ajax" target="_blank">jQuery</a></strong><strong><a href="http://docs.jquery.com/Ajax" target="_blank"> allows us to send asynchronous requests.</a></strong></p>
<ul>
<li><em><span style="color: #993300;">$.load()</span></em></li>
<li><em><span style="color: #993300;">$.get()</span></em></li>
<li><em><span style="color: #993300;">$.post()</span></em></li>
<li><em><span style="color: #993300;">$.</span></em><em><span style="color: #993300;">getJSON</span></em><em><span style="color: #993300;">()</span></em></li>
<li><em><span style="color: #993300;">$.getScript()</span></em></li>
</ul>
<p><strong> </strong></p>
<h2>$. load ()</h2>
<p>This is the feature I like most about jQuery already makes one of the most common tasks of developing with Ajax is as simple and straightforward as we shall see in this example:</p>
<pre class="brush: jscript;">
$(&quot;#div_links&quot;).load(&quot;/Main_Page #jq-p-Getting-Started li&quot;);
</pre>
<p>This example brought to <strong><a href="http://docs.jquery.com/Ajax/load#urldatacallback" target="_blank">the documentation page on </a></strong><strong><a href="http://docs.jquery.com/Ajax/load#urldatacallback" target="_blank">jQuery</a></strong>, it manages to launch a request to the URL <span style="color: #993300;"><em>/Main_Page</em></span> (usa URL Rewrite) HTML response and take the <em><span style="color: #993300;">#jq-p-Getting-Started li</span></em> and inserted into <em><span style="color: #993300;">#div_links</span></em><br />
Just great, comfortable and fast.</p>
<h2><strong>$. get ()</strong></h2>
<p>This is the simple function with which we can launch the server via GET requests Ajax.</p>
<pre class="brush: jscript;">
$.get(&quot;test.cgi&quot;, { name: &quot;Venu&quot;, time: &quot;7pm&quot; },
  function(data){
    alert(&quot;Data Loaded: &quot; + data);
  });
</pre>
<p>By passing 3 options, 2 of which are options (rather conditional) you can request to launch the file (1) with parameters (2) and treat the response through a callback (3rd).</p>
<h2><strong>$. post ()</strong></h2>
<p>Like the above, this feature lets you send POST requests using Ajax.</p>
<pre class="brush: jscript;">
$.post(&quot;test.php&quot;, { name: &quot;Venu&quot;, time: &quot;7pm&quot; },
  function(data){
    alert(&quot;Data Loaded: &quot; + data);
  });
</pre>
<p>As easy as above.</p>
<h2><strong>$. </strong><strong>getJSON</strong><strong> ()</strong></h2>
<p>Although the above are able to specify the type of return, the best option is to use this method to obtain the response in JSON evaludada the callback function.</p>
<pre class="brush: jscript;">
$.getJSON(&quot;test.js&quot;, { name: &quot;Venu&quot;, time: &quot;7pm&quot; }, function(json){
  alert(&quot;JSON Data: &quot; + json.users[3].name);
});
</pre>
<p>Taking into account the browser, the object will use <strong><a href="http://www.wisecodes.com/2009/08/everything-you-ever-wanted-to-know-about-json/">native JSON</a></strong> or use a system based on <em><span style="color: #993300;">eval()</span></em>.</p>
<h2><strong>$. </strong><strong>getScript</strong><strong> ()</strong></h2>
<p>Although technically not an Ajax request is a request to the server and therefore has a place in the post.</p>
<pre class="brush: jscript;">
$.getScript(&quot;test.js&quot;, function(){
  alert(&quot;Script loaded and executed.&quot;);
});
</pre>
<p>With this method we can load a file asynchronously using JavaScript and the parameter (2) callback can execute Javascript code that is using the js file that we want to load (1).</p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.wisecodes.com/2009/08/5-ways-to-use-ajax-with-jquery/" target="_blank"><img src="http://www.wisecodes.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.wisecodes.com/2009/08/5-ways-to-use-ajax-with-jquery/" target="_blank" title="Share on Facebook">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.wisecodes.com/2009/08/5-ways-to-use-ajax-with-jquery/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Everything you ever wanted to know about JSON</title>
		<link>http://www.wisecodes.com/2009/08/everything-you-ever-wanted-to-know-about-json/</link>
		<comments>http://www.wisecodes.com/2009/08/everything-you-ever-wanted-to-know-about-json/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 18:58:54 +0000</pubDate>
		<dc:creator>Venu Thomas</dc:creator>
				<category><![CDATA[JAVASCRIPT]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[Learn]]></category>

		<guid isPermaLink="false">http://www.wisecodes.com/?p=799</guid>
		<description><![CDATA[JSON is short for JavaScript Object Notation and is a way of storing information in an organized and easily accessible. var wcVenuThomas = { &#34;age&#34; : &#34;28&#34;, &#34;hometown&#34; : &#34;Cochin, Kerala, India&#34;, &#34;gender&#34; : &#34;male&#34; }; At first glance you get a very clear and that helps your understanding. In this example we have defined [...]]]></description>
			<content:encoded><![CDATA[<p>JSON is short for <strong>JavaScript Object Notation</strong> and is <strong><a href="http://ennuidesign.com/blog/JSON:+What+It+Is,+How+It+Works,+and+How+to+Use+It/" target="_blank">a way of storing information</a></strong> in an organized and easily accessible.</p>
<pre class="brush: jscript;">
var wcVenuThomas = {
    &quot;age&quot; : &quot;28&quot;,
    &quot;hometown&quot; : &quot;Cochin, Kerala, India&quot;,
    &quot;gender&quot; : &quot;male&quot;
};
</pre>
<p>At first glance you get a very clear and that helps your understanding. In this example we have defined a small JSON object called <em><span style="color: #993300;">wcVenuThomas</span></em> composed of a series of attributes. In this way, we can subsequently use to follow the following structure.</p>
<pre class="brush: jscript;">
alert(&quot;Venu Thomas is &quot; + wcVenuThomas.age );
</pre>
<h2>Functions (not to carry information)</h2>
<p>Thanks to the versatility of the variables in JavaScript it is possible to match one of these attributes to a function, creating a method of the object itself:</p>
<pre class="brush: jscript;">
var wcVenuThomas = {
    &quot;age&quot; : &quot;28&quot;,
    &quot;hometown&quot; : &quot;Cochin, Kerala, India&quot;,
    &quot;gender&quot; : &quot;male&quot;
    &quot;salute&quot; : function(strString) {
    	alert(&quot;hello, &quot; + strString + &quot;! I'm Venu Thomas from &quot; + this.hometown + &quot;, How are you?&quot;);
    },
};
</pre>
<p>Now you can <em><span style="color: #993300;">salute()</span></em> <img src='http://www.wisecodes.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' /> </p>
<pre class="brush: jscript;"> var usrName = &quot;John James&quot;
wcVenuThomas.salute(usrName);
</pre>
<p>As part of the JSON object, we can make use of the attributes from the same method by using this operator.</p>
<p><strong> The functions do not make sense to use JSON as a conveyor of information, so we leave it alone as a curious object notation </strong> <img src='http://www.wisecodes.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' /> </p>
<h2>Arrays</h2>
<p>Another option to the JSON is the ability to insert arrays as attributes and in turn define elements within JSON:</p>
<pre class="brush: jscript;">
var wcVenuThomas = {
    &quot;age&quot; : &quot;28&quot;,
    &quot;hometown&quot; : &quot;Cochin, Kerala, India&quot;,
    &quot;gender&quot; : &quot;male&quot;
    &quot;salute&quot; : function(strString) {
    	alert(&quot;hello I'm Venu Thomas from &quot; + this.hometown + &quot;, How are you? &quot; + strString + &quot;?&quot;);
    },
    &quot;projects&quot;:[
    	{
    		&quot;name&quot; : 	&quot;Apple News and Analytics &quot;,
    		&quot;url&quot;		 : 	&quot;http://apple.wisecodes.com&quot;
    	},
    	{
    		&quot;name&quot; :	&quot;Life Style Blog&quot;,
    		&quot;url&quot;		 :  &quot;http://telegraph.wisecodes.com&quot;
    	}
    ]
};
</pre>
<p>In this way we can travel an arrays are:</p>
<pre class="brush: jscript;">
var projects = wcVenuThomas.projects, html = '';
for (var x = 0 ; x &lt; projects.length ; x++) {
html += '&lt;li&gt;&lt;a href=&quot;' + projects[x].url + '&quot;&gt;' + projects[x].name + '&lt;/a&gt;&lt;/li&gt;';
}
</pre>
<h2>JSON object chaining</h2>
<p>Another way of grouping elements is to use JSON JSON objects embedded within other objects JSON:</p>
<pre class="brush: jscript;">
var wcVenuThomas = {
    &quot;age&quot; : &quot;28&quot;,
    &quot;hometown&quot; : &quot;Cochin, Kerala, India&quot;,
    &quot;gender&quot; : &quot;male&quot;
    &quot;salute&quot; : function(strString) {
    	alert(&quot;hello I'm Venu Thomas from &quot; + this.hometown + &quot;, How are you? &quot; + strString + &quot;?&quot;);
    },
    &quot;projects&quot;:{
    	&quot;applenews&quot;: {
    		&quot;url&quot;		 : 	&quot;http://apple.wisecodes.com&quot;
},
  	  &quot;lifestyleblog&quot;: {
    		&quot;url&quot;		 :  &quot;http://telegraph.wisecodes.com&quot;
}
    }
};
</pre>
<p>As we can see, really the only thing we have done is to insert an object into a JSON attribute father, so we can access it as follows:</p>
<pre class="brush: jscript;">
var URL = wcVenuThomas.projects.applenews.url;
</pre>
<h2>Practical uses</h2>
<p>As data storage system, is ideal for transporting from one page to another, even a website to another. A very simple and is used to obtain data from Flickr using jQuery to get data.</p>
<pre class="brush: jscript;">
$.getJSON(&quot;http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&amp;tagmode=any&amp;format=json&amp;jsoncallback=?&quot;,
        function(data){
          $.each(data.items, function(i,item){
            $(&quot;&lt;img/&gt;&quot;).attr(&quot;src&quot;, item.media.m).appendTo(&quot;#images&quot;);
            if ( i == 3 ) return false;
          });
        });
</pre>
<p>In this example, taken from <strong><a href="http://docs.jquery.com/Ajax/jQuery.getJSON">the documentation of jQuery</a></strong>, as we launched a call for <strong><a href="http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&amp;tagmode=any&amp;format=json&amp;jsoncallback=?">the latest images sent to Flickr that have been scheduled with the tag &#8220;Cat&#8221;</a></strong>. The result will be evaluated and processed to the end to reach us within data, a variable that can go as if we were talking about a variable.</p>
<h2>Native JSON</h2>
<p>One of the problems encountered with JSON is the assessment of code, since it must be transformed into a variable to use, and this requires the use of <span style="color: #993300;"><em>eval()</em></span> which makes the process time is increased considerably .</p>
<pre class="brush: jscript;">
// Eval
var myObject = eval('(' + myJSONtext + ')');

// Native JSON
var myObject = JSON.parse(myJSONtext);

// Mix
var myObject = (JSON)?JSON.parse(myJSONtext): eval('(' + myJSONtext + ')');
</pre>
<p>Fortunately, modern browsers (<strong><a href="http://blogs.msdn.com/ie/archive/2008/09/10/native-json-in-ie8.aspx">IE8</a></strong>, <strong><a href="https://developer.mozilla.org/En/Using_JSON_in_Firefox">FF3.5</a></strong>, WebKit, &#8230;.) <strong><a href="http://ejohn.org/blog/native-json-support-is-required/">Features are implemented</a></strong> to forget <em><span style="color: #993300;">eval()</span></em> and improve the process time.</p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.wisecodes.com/2009/08/everything-you-ever-wanted-to-know-about-json/" target="_blank"><img src="http://www.wisecodes.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.wisecodes.com/2009/08/everything-you-ever-wanted-to-know-about-json/" target="_blank" title="Share on Facebook">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.wisecodes.com/2009/08/everything-you-ever-wanted-to-know-about-json/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Javascript: Tic Tac Toe</title>
		<link>http://www.wisecodes.com/2009/08/javascript-tic-tac-toe/</link>
		<comments>http://www.wisecodes.com/2009/08/javascript-tic-tac-toe/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 15:17:33 +0000</pubDate>
		<dc:creator>Venu Thomas</dc:creator>
				<category><![CDATA[JAVASCRIPT]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[OpenSource]]></category>

		<guid isPermaLink="false">http://www.wisecodes.com/?p=741</guid>
		<description><![CDATA[View Demo Download Code [3.29 kb] Playing The computer always plays with circles ( &#8220;O&#8221;) and you with blades ( &#8220;X&#8221;). Start your. To put an X have to click on the button the bottom panel that corresponds to the position you want to put it. You can also hand-write it, always with capital letters [...]]]></description>
			<content:encoded><![CDATA[<h2><a href="http://wisecodes.com/Code/TicTacToeJavascript/TicTacToe.html" target="_blank"><img class="alignnone size-full wp-image-18" title="live_preview" src="http://www.wisecodes.com/wp-content/uploads/2009/02/live_preview.png" alt="live_preview" width="32" height="32" /> View Demo</a> <a href="http://wisecodes.com/Code/TicTacToeJavascript/TicTacToe.rar"><img class="alignnone size-full wp-image-29" title="download" src="http://www.wisecodes.com/wp-content/uploads/2009/02/download.gif" alt="download" width="32" height="35" />Download Code</a> [3.29 kb]</h2>
<h2>Playing</h2>
<p>The computer always plays with <em> circles </em> ( &#8220;O&#8221;) and you with <em> blades </em><br />
( &#8220;X&#8221;). Start your. To put an X <em> </em> have to click on the button<br />
the bottom panel that corresponds to the position you want to put it. You can<br />
also hand-write it, always with capital letters (without cheating, because the<br />
computer trusts you).</p>
<p>The computer will make its <em> redondel </em> every time you put your <em> X </em>.<br />
Never make a mistake, and if you neglect (and you do not cheat), you win. If you cheat, do not<br />
work correctly.</p>
<p>When the game ends, the computer shows the result and increase the counters<br />
lower. To play another game, press the button again <strong> Game </strong>, which<br />
Clean the panel game. To clear the counters, click the Clear button <strong>Clear</strong>.</p>
<p>This < head> between and <strong><</strong>/head>:</p>
<pre class="brush: xml;">
&lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&gt;
// Tic Tac Toe
// Version: 1 (10/08/2009)
// Venu Thomas
// This script and many others can
// download online for free
// in the code: [url = http://www.wisecodes.com] www.wisecodes.com [/ url] 

// To understand the explanations:
// Win - and win puts
// Game - and has put in a two-line 'O' and an empty box
// Defend - keep winning the next move in the opposite
// It makes no sense at first occupy the center if there is victory or play
// There must defend first and attack later. First look for the victory, then
// search and then defends move 

// global variable
var strPlaying = true   

//ROLE PLAY CHECK------------------------------------------------
function wc_fnCheckPlay(grid, record) {
    // check that it is possible to stripe 3 in a row, column or diagonal
     // returns the position where you have to put the record to do so and -1 if there is no gamble   

    var x, y   

    for(x = 0; x &lt; 9; x += 3) {      //Check the rows
        if ((grid.elements[x].value == record) &amp;&amp; (grid.elements[x + 1].value == record))
            if (grid.elements[x + 2].value == &quot;&quot;)
                return (x + 2)
        if ((grid.elements[x].value == record) &amp;&amp; (grid.elements[x + 2].value == record))
            if (grid.elements[x + 1].value == &quot;&quot;)
                return (x + 1)
        if ((grid.elements[x + 1].value == record) &amp;&amp; (grid.elements[x + 2].value == record))
            if (grid.elements[x].value == &quot;&quot;)
                return (x)
    }   

    for(x = 0; x &lt; 3; x++) {     //Check the columns
        if ((grid.elements[x].value == record) &amp;&amp; (grid.elements[x + 3].value == record))
            if (grid.elements[x + 6].value == &quot;&quot;)
                return (x + 6)
        if ((grid.elements[x].value == record) &amp;&amp; (grid.elements[x + 6].value == record))
            if (grid.elements[x + 3].value == &quot;&quot;)
                return (x + 3)
        if ((grid.elements[x + 3].value == record) &amp;&amp; (grid.elements[x + 6].value == record))
            if (grid.elements[x].value == &quot;&quot;)
                return (x)
    }   

    //check the diagonals
    if ((grid.elements[2].value == record) &amp;&amp; (grid.elements[4].value == record) &amp;&amp; (grid.elements[6].value == &quot;&quot;))
        return (6)
    if ((grid.elements[2].value == record) &amp;&amp; (grid.elements[4].value == &quot;&quot;) &amp;&amp; (grid.elements[6].value == record))
        return (4)
    if ((grid.elements[2].value == &quot;&quot;) &amp;&amp; (grid.elements[4].value == record) &amp;&amp; (grid.elements[6].value == record))
        return (2)
    if ((grid.elements[0].value == record) &amp;&amp; (grid.elements[4].value == record) &amp;&amp; (grid.elements[8].value == &quot;&quot;))
        return (8)
    if ((grid.elements[0].value == record) &amp;&amp; (grid.elements[4].value == &quot;&quot;) &amp;&amp; (grid.elements[8].value == record))
        return (4)
    if ((grid.elements[0].value == &quot;&quot;) &amp;&amp; (grid.elements[4].value == record) &amp;&amp; (grid.elements[8].value == record))
        return (0)   

    return -1
}   

//HORIZONTAL PARTNER ROLE
function wc_fnPartnerHorizontal(grid, record) {
    // check if it's possible to put 2 in a row, the other empty position ...
     //... same row
     // returns the row to do so, or -1 if not 

    var x, y   

    for(x = 0; x &lt; 9; x += 3) {      //Check the rows
        if ((grid.elements[x].value == record) &amp;&amp; (grid.elements[x + 1].value == &quot;&quot;) &amp;&amp; (grid.elements[x + 2].value == &quot;&quot;))
            return (x)
        if ((grid.elements[x].value == &quot;&quot;) &amp;&amp; (grid.elements[x + 1].value == record) &amp;&amp; (grid.elements[x + 2].value == &quot;&quot;))
            return (x + 1)
        if ((grid.elements[x].value == &quot;&quot;) &amp;&amp; (grid.elements[x + 1].value == &quot;&quot;) &amp;&amp; (grid.elements[x + 2].value == record))
            return (x + 2)
    }   

    return -1
}   

//VERTICAL PARTNER ROLE---------------------------------------------------
function wc_fnPartnerVertical(grid, record, playHtal) {
 // check if it's possible to put 2 in a column, the other empty position ...
     //... same column and taking into account whether that position is horizontal pair
     // returns the column if you do not allow horizontal pair, or -1 if not      

    var x, y   

    for(x = 0; x &lt; 3; x++) {         //check the columns
        if ((grid.elements[x].value == record) &amp;&amp; (grid.elements[x + 3].value == &quot;&quot;) &amp;&amp; (grid.elements[x + 6].value == &quot;&quot;))
            if (x != playHtal)        //if partner not interested in horizontal and vertical
                return (x)
        if ((grid.elements[x].value == &quot;&quot;) &amp;&amp; (grid.elements[x + 3].value == record) &amp;&amp; (grid.elements[x + 6].value == &quot;&quot;))
            if ((x + 3) != playHtal)
                return (x + 3)
        if ((grid.elements[x].value == &quot;&quot;) &amp;&amp; (grid.elements[x + 3].value == &quot;&quot;) &amp;&amp; (grid.elements[x + 6].value == record))
            if ((x + 6) != playHtal)
                return (x + 6)
    }   

    return -1
}   

//Get POSITION\
function wc_fnGetPosition(playHtal, playVcal) {
 // Find the position that allows you move vertically and horizontally at the same time move
     // known row and column where couples can be

    var x, y, fila, columna
    var position = 0
    matrix = new Array(3)   

    for (x = 0; x &lt; 3; x++) {        //creates a matrix that assigns a row and column position
        matrix[x] = new Array(3)
        for (y = 0; y &lt; 3; y++) {
            matrix[x][y] = position
            position ++
        }
    }   

    for (x = 0; x &lt; 3; x++) {                    //looking for the row and column
        for (y = 0; y &lt; 3; y++) {
            if (matrix[x][y] == playHtal) //find the row
                fila = x
            if (matrix[x][y] == playVcal) //I found the column
                columna = y
        }
    }   

    return (matrix[fila][columna])          //move back position
}   

//FUNCION REDONDELA PUT-------------------------------------------------
function wc_fnPutRedondela(grid) {
    //the ordanador plays

    var play, playHtal, playVcal   

    //attacks and wins
    play = wc_fnCheckPlay(grid, &quot;O&quot;)
    if (play != -1) {
        grid.elements[play].value = &quot;O&quot;
        alert('I won!!!')
        document.scoreboard.missing.value++
        strPlaying = false
        return 1
    }   

    //advocates avoiding the rival wins
    play = wc_fnCheckPlay(grid, &quot;X&quot;)
    if (play != -1) {
        grid.elements[play].value = &quot;O&quot;
        return 1
    }   

    //attacks and win the next
    playHtal = wc_fnPartnerHorizontal(grid, &quot;O&quot;)
    playVcal = wc_fnPartnerVertical(grid, &quot;O&quot;, playHtal)
    if ((playHtal != -1) &amp;&amp; (playVcal != -1)) {     //you can put 2 and 2 in a row in column
        if ((playHtal != 4) || (playVcal != 4)) {       //is not the center
            play = wc_fnGetPosition(playHtal, playVcal)  //gets where it should put
            grid.elements[play].value = &quot;O&quot;
            return 1
        }
    }   

    //attacks and put two in a row
    if ((playHtal != -1) &amp;&amp; (playVcal == -1)) {
        if ((playHtal != 2) &amp;&amp; (playHtal != 5) &amp;&amp; (playHtal != 8))    //this is arbitrary
            grid.elements[playHtal + 1].value = &quot;O&quot;                        //puts the right
        else
            grid.elements[playHtal - 1].value = &quot;O&quot;                        //placed to the left
        return 1
    }   

    //attacks and put in two column
    if ((playHtal == -1) &amp;&amp; (playVcal != -1)) {
        if ((playVcal != 6) &amp;&amp; (playVcal != 7) &amp;&amp; (playVcal != 8))
            grid.elements[playVcal + 3].value = &quot;O&quot;        //put down
        else
            grid.elements[playVcal - 3].value = &quot;O&quot;        //puts up
        return 1
    }   

    //occupies the center
    if (grid.elements[4].value == &quot;&quot;) {
        grid.elements[4].value = &quot;O&quot;
        return 1
    }   

    //This took the first free
    for (x = 0; x &lt; 9; x++)
        if (grid.elements[x].value == &quot;&quot;) {
            grid.elements[x].value = &quot;O&quot;
            return 1
        }   

    alert('Draw...')
    document.scoreboard.draw.value++
    strPlaying = false
    return -1
}   

//FUNCION PUT ASPA
function wc_fnPutAspa(grid, position) {   

    //first check that this strPlaying
    if (strPlaying) {
        if (grid.elements[position].value != &quot;&quot;)     //empty box
            alert('That box is already occupied.')
        else {                                                  //empty box, you can put
            grid.elements[position].value = &quot;X&quot;  

            //Check if you have won
            if ( wc_fnNotesVictoria(grid, &quot;X&quot;) ) {
                alert('Congratulations! You win... <img src='http://www.wisecodes.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> ')
                document.scoreboard.won.value++
                strPlaying = false
            } else
                wc_fnPutRedondela(grid)
        }
    } else {
        alert('To start a new line \nClick Play again.')
    }
}   

//VICTORIA FUNCTION CHECK
function wc_fnNotesVictoria(grid, record) {   

    //Check if you have earned the record player that plays with  

    var x   

    for(x = 0; x &lt; 9; x += 3) {  //Check the rows
        if ((grid.elements[x].value == record) &amp;&amp; (grid.elements[x + 1].value == record) &amp;&amp; (grid.elements[x + 2].value == record))
            return true
    }   

    for(x = 0; x &lt; 3; x++) {     //check the columns
        if ((grid.elements[x].value == record) &amp;&amp; (grid.elements[x + 3].value == record) &amp;&amp; (grid.elements[x + 6].value == record))
            return true
    }   

    //check the diagonals
    if ((grid.elements[2].value == record) &amp;&amp; (grid.elements[4].value == record) &amp;&amp; (grid.elements[6].value == record))
        return true
    if ((grid.elements[0].value == record) &amp;&amp; (grid.elements[4].value == record) &amp;&amp; (grid.elements[8].value == record))
        return true   

    return false
}   

&lt;/script&gt;
</pre>
<p>And this from <strong><</strong>body> and <strong><</strong>/body> :</p>
<pre class="brush: xml;">
&lt;!-- To display the grid, and Accountants --&gt;
&lt;form name=&quot;grid&quot;&gt;
  &lt;div align=&quot;center&quot;&gt;&lt;center&gt;
  &lt;table border=&quot;0&quot; width=&quot;62%&quot; cellpadding=&quot;5&quot;&gt;
    &lt;tr&gt;
      &lt;td width=&quot;20%&quot;&gt;&lt;input type=&quot;text&quot; name=&quot;T0&quot; size=&quot;3&quot;&gt;&lt;/td&gt;
      &lt;td width=&quot;20%&quot;&gt;&lt;input type=&quot;text&quot; name=&quot;T1&quot; size=&quot;3&quot;&gt;&lt;/td&gt;
      &lt;td width=&quot;20%&quot;&gt;&lt;input type=&quot;text&quot; name=&quot;T2&quot; size=&quot;3&quot;&gt;&lt;/td&gt;
      &lt;td width=&quot;85%&quot; align=&quot;right&quot;&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td width=&quot;20%&quot;&gt;&lt;input type=&quot;text&quot; name=&quot;T3&quot; size=&quot;3&quot;&gt;&lt;/td&gt;
      &lt;td width=&quot;20%&quot;&gt;&lt;input type=&quot;text&quot; name=&quot;T4&quot; size=&quot;3&quot;&gt;&lt;/td&gt;
      &lt;td width=&quot;20%&quot;&gt;&lt;input type=&quot;text&quot; name=&quot;T5&quot; size=&quot;3&quot;&gt;&lt;/td&gt;
      &lt;td width=&quot;85%&quot; align=&quot;right&quot;&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td width=&quot;20%&quot;&gt;&lt;input type=&quot;text&quot; name=&quot;T6&quot; size=&quot;3&quot;&gt;&lt;/td&gt;
      &lt;td width=&quot;20%&quot;&gt;&lt;input type=&quot;text&quot; name=&quot;T7&quot; size=&quot;3&quot;&gt;&lt;/td&gt;
      &lt;td width=&quot;20%&quot;&gt;&lt;input type=&quot;text&quot; name=&quot;T8&quot; size=&quot;3&quot;&gt;&lt;/td&gt;
      &lt;td width=&quot;85%&quot; align=&quot;right&quot;&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td width=&quot;20%&quot;&gt;&lt;input type=&quot;button&quot; value=&quot; X &quot; name=&quot;B0&quot; onClick=&quot;wc_fnPutAspa(grid, 0)&quot; class=&quot;metal&quot;&gt;&lt;/td&gt;
      &lt;td width=&quot;20%&quot;&gt;&lt;input type=&quot;button&quot; value=&quot; X &quot; name=&quot;B1&quot; onClick=&quot;wc_fnPutAspa(grid, 1)&quot; class=&quot;metal&quot;&gt;&lt;/td&gt;
      &lt;td width=&quot;20%&quot;&gt;&lt;input type=&quot;button&quot; value=&quot; X &quot; name=&quot;B2&quot; onClick=&quot;wc_fnPutAspa(grid, 2)&quot; class=&quot;metal&quot;&gt;&lt;/td&gt;
      &lt;td width=&quot;85%&quot;&gt;&lt;input type=&quot;reset&quot; value=&quot;New game&quot; name=&quot;new&quot; onClick=&quot;strPlaying=true&quot; class=&quot;metal&quot;&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td width=&quot;18%&quot;&gt;&lt;input type=&quot;button&quot; value=&quot; X &quot; name=&quot;B3&quot; onClick=&quot;wc_fnPutAspa(grid, 3)&quot; class=&quot;metal&quot;&gt;&lt;/td&gt;
      &lt;td width=&quot;17%&quot;&gt;&lt;input type=&quot;button&quot; value=&quot; X &quot; name=&quot;B4&quot; onClick=&quot;wc_fnPutAspa(grid, 4)&quot; class=&quot;metal&quot;&gt;&lt;/td&gt;
      &lt;td width=&quot;18%&quot;&gt;&lt;input type=&quot;button&quot; value=&quot; X &quot; name=&quot;B5&quot; onClick=&quot;wc_fnPutAspa(grid, 5)&quot; class=&quot;metal&quot;&gt;&lt;/td&gt;
      &lt;td width=&quot;85%&quot;&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td width=&quot;18%&quot;&gt;&lt;input type=&quot;button&quot; value=&quot; X &quot; name=&quot;B6&quot; onClick=&quot;wc_fnPutAspa(grid, 6)&quot; class=&quot;metal&quot;&gt;&lt;/td&gt;
      &lt;td width=&quot;17%&quot;&gt;&lt;input type=&quot;button&quot; value=&quot; X &quot; name=&quot;B7&quot; onClick=&quot;wc_fnPutAspa(grid, 7)&quot; class=&quot;metal&quot;&gt;&lt;/td&gt;
      &lt;td width=&quot;18%&quot;&gt;&lt;input type=&quot;button&quot; value=&quot; X &quot; name=&quot;B8&quot; onClick=&quot;wc_fnPutAspa(grid, 8)&quot; class=&quot;metal&quot;&gt;&lt;/td&gt;
      &lt;td width=&quot;85%&quot; align=&quot;right&quot;&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/center&gt;&lt;/div&gt;
&lt;/form&gt;

&lt;form name=&quot;scoreboard&quot;&gt;
  &lt;div align=&quot;center&quot;&gt;&lt;center&gt;
  &lt;table border=&quot;0&quot; width=&quot;62%&quot; cellpadding=&quot;5&quot; cellspacing=&quot;0&quot;&gt;
    &lt;tr&gt;
      &lt;td width=&quot;20%&quot;&gt;&lt;small&gt;draw:&lt;br&gt;
      &lt;/small&gt;&lt;input type=&quot;text&quot; name=&quot;draw&quot; value=&quot;0&quot; size=&quot;6&quot;&gt;&lt;/td&gt;
      &lt;td width=&quot;20%&quot;&gt;&lt;small&gt;missing:&lt;br&gt;
      &lt;/small&gt;&lt;input type=&quot;text&quot; name=&quot;missing&quot; value=&quot;0&quot; size=&quot;6&quot;&gt;&lt;/td&gt;
      &lt;td width=&quot;20%&quot;&gt;&lt;small&gt;won:&lt;br&gt;
      &lt;/small&gt;&lt;input type=&quot;text&quot; name=&quot;won&quot; value=&quot;0&quot; size=&quot;6&quot;&gt;&lt;/td&gt;
      &lt;td width=&quot;85%&quot;&gt; &lt;br&gt;&lt;input type=&quot;reset&quot; value=&quot;Clear&quot; name=&quot;delete&quot; class=&quot;metal&quot;&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/center&gt;&lt;/div&gt;
&lt;/form&gt;

&lt;h2&gt;Playing&lt;/h2&gt;
&lt;p&gt;The computer always plays with &lt;em&gt; circles &lt;/em&gt; ( &quot;O&quot;) and you with &lt;em&gt; blades &lt;/em&gt;
( &quot;X&quot;). Start your. To put an X &lt;em&gt; &lt;/em&gt; have to click on the button
the bottom panel that corresponds to the position you want to put it. You can
also hand-write it, always with capital letters (without cheating, because the
computer trusts you).&lt;/p&gt;
&lt;p&gt;The computer will make its &lt;em&gt; redondel &lt;/em&gt; every time you put your &lt;em&gt; X &lt;/em&gt;.
Never make a mistake, and if you neglect (and you do not cheat), you win. If you cheat, do not
work correctly.&lt;/p&gt;
&lt;p&gt;When the game ends, the computer shows the result and increase the counters
lower. To play another game, press the button again &lt;strong&gt; Game &lt;/strong&gt;, which
Clean the panel game. To clear the counters, click the Clear button &lt;strong&gt;Clear&lt;/strong&gt;.&lt;/p&gt;
</pre>
<p>Happy Programming!!! <img src='http://www.wisecodes.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.wisecodes.com/2009/08/javascript-tic-tac-toe/" target="_blank"><img src="http://www.wisecodes.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.wisecodes.com/2009/08/javascript-tic-tac-toe/" target="_blank" title="Share on Facebook">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.wisecodes.com/2009/08/javascript-tic-tac-toe/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>10 javascript frameworks that need to know</title>
		<link>http://www.wisecodes.com/2009/08/10-javascript-frameworks-that-need-to-know/</link>
		<comments>http://www.wisecodes.com/2009/08/10-javascript-frameworks-that-need-to-know/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 14:08:13 +0000</pubDate>
		<dc:creator>Venu Thomas</dc:creator>
				<category><![CDATA[JAVASCRIPT]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[WebDev]]></category>

		<guid isPermaLink="false">http://www.wisecodes.com/?p=729</guid>
		<description><![CDATA[Web developers, designers and typesetters should already know JavaScript. The javascript does not know should Wearing batteries to keep the language client for the future (and present). For those who defend us a little on the subject and we extend our capacity and speed of development can opt to use a framework to give us [...]]]></description>
			<content:encoded><![CDATA[<p>Web developers, designers and typesetters should already know JavaScript. The javascript does not know should Wearing batteries to keep the language client for the future (and present).<br />
For those who defend us a little on the subject and we extend our capacity and speed of development <strong><a href="http://sixrevisions.com/javascript/promising_javascript_frameworks/" target="_blank">can opt to use a framework</a></strong> to give us a lot of options for everyday use.</p>
<p>* <strong><a href="http://www.sproutcore.com/" target="_blank">SproutCore</a></strong><br />
* <strong><a href="http://labs.adobe.com/technologies/spry/" target="_blank">Spry</a></strong><br />
* <strong><a href="http://javascriptmvc.com/" target="_blank">JavaScriptMVC</a></strong><br />
* <strong><a href="http://qooxdoo.org/" target="_blank">qooxdoo</a></strong><br />
* <strong><a href="http://www.midorijs.com/" target="_blank">Midori</a></strong><br />
* <strong><a href="http://archetypejs.org/" target="_blank">Archetype JavaScript Framework</a></strong><br />
* <strong><a href="http://june-js.com/" target="_blank">June Framework</a></strong><br />
* <strong><a href="http://www.uize.com/" target="_blank">UIZE</a></strong><br />
* <strong><a href="http://simplejs.bleebot.com/" target="_blank">SimpleJS</a></strong><br />
* <strong><a href="http://js.fleegix.org/" target="_blank">Fleegix.js</a></strong></p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.wisecodes.com/2009/08/10-javascript-frameworks-that-need-to-know/" target="_blank"><img src="http://www.wisecodes.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.wisecodes.com/2009/08/10-javascript-frameworks-that-need-to-know/" target="_blank" title="Share on Facebook">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.wisecodes.com/2009/08/10-javascript-frameworks-that-need-to-know/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multiline in JavaScript</title>
		<link>http://www.wisecodes.com/2009/08/javascript-multiline/</link>
		<comments>http://www.wisecodes.com/2009/08/javascript-multiline/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 19:52:41 +0000</pubDate>
		<dc:creator>Venu Thomas</dc:creator>
				<category><![CDATA[JAVASCRIPT]]></category>
		<category><![CDATA[OpenSource]]></category>

		<guid isPermaLink="false">http://www.wisecodes.com/?p=717</guid>
		<description><![CDATA[Whenever you try to write a script in Javascript that requires a string of multiple lines get an error code that is poorly trained. That is a problem for these scripts to generate HTML content, because by having a clear line and we lose we do not see exactly what you&#8217;re painting. $('#ID').append( '&#60;div id=&#34;wcDIV&#34;&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>Whenever you try to write a script in Javascript that requires a string of multiple lines get an error code that is poorly trained. That is a problem for these scripts to generate HTML content, because by having a clear line and we lose we do not see exactly what you&#8217;re painting.</p>
<pre class="brush: jscript;">
$('#ID').append(
   '&lt;div id=&quot;wcDIV&quot;&gt; \
      &lt;p&gt;Welcome to WiseCodes.Com!&lt;/p&gt; \
    &lt;/div&gt;'
);

var strWelcome = 'Welcome \
to WiseCodes.Com!'
</pre>
<p>The key is used (\) to indicate the line, that mysteriously causes the browser detects that it is a single line, making the job of uniting us.<br />
A curiosity of this language that helps us to make things easier and above all clear.</p>
<p>Happy Programming !!! <img src='http://www.wisecodes.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.wisecodes.com/2009/08/javascript-multiline/" target="_blank"><img src="http://www.wisecodes.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.wisecodes.com/2009/08/javascript-multiline/" target="_blank" title="Share on Facebook">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.wisecodes.com/2009/08/javascript-multiline/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The best way to load javascript</title>
		<link>http://www.wisecodes.com/2009/08/the-best-way-to-load-javascript/</link>
		<comments>http://www.wisecodes.com/2009/08/the-best-way-to-load-javascript/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 16:27:55 +0000</pubDate>
		<dc:creator>Venu Thomas</dc:creator>
				<category><![CDATA[JAVASCRIPT]]></category>
		<category><![CDATA[OpenSource]]></category>

		<guid isPermaLink="false">http://www.wisecodes.com/?p=703</guid>
		<description><![CDATA[Nicholas C. Zakas has been thinking about the issue and has taken 3 points needed to be taken to improve the load javascript on our pages. * Create two files Javascript. In the first place you need to dynamically load another javascript file and the second with the code needed for our application. * Javascript [...]]]></description>
			<content:encoded><![CDATA[<p><strong><a href="http://www.nczonline.net/blog/2009/07/28/the-best-way-to-load-external-javascript/" target="_blank">Nicholas C. Zakas has been thinking about the issue</a></strong> and has taken 3 points needed to be taken to improve the load javascript on our pages.</p>
<p>* Create two files Javascript. In the first place you need to dynamically load another javascript file and the second with the code needed for our application.<br />
* Javascript includes the first end of the page just above <em>&lt; / body &gt;</em><br />
* Just below we create a second tag <em>&lt; script &gt;</em> where to call / the file / s needed.</p>
<p>Our HTML would be more or less like this:</p>
<pre class="brush: jscript;">
&lt;script type=&quot;text/javascript&quot; src=&quot;http://your.cdn.com/first.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
loadScript(&quot;http://your.cdn.com/second.js&quot;, function(){
//initialization code
});
&lt;/script&gt;
</pre>
<h3>loadScript ()</h3>
<p>loadScript () function is responsible for loading the Javascript file in a dynamic and responsible for implementing the code as the second parameter to indicate when it is loaded correctly.</p>
<pre class="brush: jscript;">
function loadScript(url, callback){

var script = document.createElement(&quot;script&quot;)
script.type = &quot;text/javascript&quot;;

if (script.readyState){  //IE
script.onreadystatechange = function(){
if (script.readyState == &quot;loaded&quot; ||
script.readyState == &quot;complete&quot;){
script.onreadystatechange = null;
callback();
}
};
} else {  //Others
script.onload = function(){
callback();
};
}

script.src = url;
document.getElementsByTagName(&quot;head&quot;)[0].appendChild(script);
}
</pre>
<p>Clearly, these optimizations improve outcome, although we are talking about milliseconds (or seconds in the worst case). But it&#8217;s good to know how to improve our scripts and pulirlos well.</p>
<p>Happy Programming!!! <img src='http://www.wisecodes.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.wisecodes.com/2009/08/the-best-way-to-load-javascript/" target="_blank"><img src="http://www.wisecodes.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.wisecodes.com/2009/08/the-best-way-to-load-javascript/" target="_blank" title="Share on Facebook">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.wisecodes.com/2009/08/the-best-way-to-load-javascript/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Doodle.js, library for working with canvas</title>
		<link>http://www.wisecodes.com/2009/07/doodle-js-library-for-working-with-canvas/</link>
		<comments>http://www.wisecodes.com/2009/07/doodle-js-library-for-working-with-canvas/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 20:43:39 +0000</pubDate>
		<dc:creator>Venu Thomas</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[JAVASCRIPT]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[OpenSource]]></category>

		<guid isPermaLink="false">http://www.wisecodes.com/?p=621</guid>
		<description><![CDATA[Doodle.js is a library that allows us to easily work with the element &#60;canvas /&#62; and everything that entails. With a similar aesthetic to jQuery, drawing on the canvas that is &#60;canvas /&#62; is as simple as this: &#60;head&#62; &#60;!--[if IE]&#62;&#60;script type=&#34;text/javascript&#34; src=&#34;http://explorercanvas.googlecode.com/svn/trunk/excanvas.js&#34;&#62;&#60;/script&#62;&#60;![endif]--&#62; &#60;script src=&#34;./doodle-0.1.js&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62; &#60;script type=&#34;text/javascript&#34;&#62; function init() { (function(oo) { oo.canvas('#my_canvas'); oo.rect({x:25, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.lamberta.org/blog/doodle/" target="_blank">Doodle.js</a> is a library that allows us to easily work with the element &lt;canvas /&gt; and <a href="http://www.wisecodes.com/2009/06/detection-of-faces-on-canvas-with-javascript/" target="_blank">everything that entails</a>. With a similar aesthetic to jQuery, <a href="http://www.wisecodes.com/tag/canvas/" target="_blank">drawing on the canvas that is</a> &lt;canvas /&gt; is as simple as this:</p>
<pre class="brush: xml;">

  &lt;head&gt;
  &lt;!--[if IE]&gt;&lt;script type=&quot;text/javascript&quot; src=&quot;http://explorercanvas.googlecode.com/svn/trunk/excanvas.js&quot;&gt;&lt;/script&gt;&lt;![endif]--&gt;
  &lt;script src=&quot;./doodle-0.1.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
  &lt;script type=&quot;text/javascript&quot;&gt;
    function init() {
      (function(oo) {
  oo.canvas('#my_canvas');
  oo.rect({x:25, y:25, width:50, height:50}).draw();

})($doodle);

    };
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;!--init() is called when the canvas is ready for us.--&gt;
  &lt;body onload=&quot;javascript:init();&quot;&gt;
    &lt;canvas id=&quot;my_canvas&quot; width=&quot;600&quot; height=&quot;400&quot;&gt;
      &lt;p&gt;Fallback: Canvas element is not supported in this browser!&lt;/p&gt;
    &lt;/canvas&gt;
  &lt;/body&gt;
</pre>
<h4>Examples</h4>
<p>Do not miss some of the examples available on the homepage of the library:<br />
<a href="http://www.lamberta.org/demo/js/doodle/examples/01/spiral.html" target="_blank"> Spiral multicolor</a><br />
<a href="http://www.lamberta.org/demo/js/doodle/examples/01/bouncy.html" target="_blank"> Rebounds multiple</a></p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.wisecodes.com/2009/07/doodle-js-library-for-working-with-canvas/" target="_blank"><img src="http://www.wisecodes.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.wisecodes.com/2009/07/doodle-js-library-for-working-with-canvas/" target="_blank" title="Share on Facebook">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.wisecodes.com/2009/07/doodle-js-library-for-working-with-canvas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Detection of faces on canvas with Javascript</title>
		<link>http://www.wisecodes.com/2009/06/detection-of-faces-on-canvas-with-javascript/</link>
		<comments>http://www.wisecodes.com/2009/06/detection-of-faces-on-canvas-with-javascript/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 19:14:03 +0000</pubDate>
		<dc:creator>Venu Thomas</dc:creator>
				<category><![CDATA[JAVASCRIPT]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[OpenSource]]></category>

		<guid isPermaLink="false">http://www.wisecodes.com/?p=602</guid>
		<description><![CDATA[Detect faces and is not just for Google Images. Now you can implement it on your website using Javascript and the canvas properties. How it works? To do this we need to work only 2 files in our &#60;head /&#62; ?View Code HTML&#60;script type=&#34;text/javascript&#34; src=&#34;dat.js&#34;&#62;&#60;/script&#62; &#60;script type=&#34;text/javascript&#34; src=&#34;detector.js&#34;&#62;&#60;/script&#62; Dat.js the file shows how to detect [...]]]></description>
			<content:encoded><![CDATA[<p>Detect faces and is not just for Google Images. Now you can <a href="http://blog.kpicturebooth.com/?p=8" target="_blank">implement it on your website using Javascript and the canvas properties.</a></p>
<p><a rel="attachment wp-att-606" href="http://www.wisecodes.com/2009/06/detection-of-faces-on-canvas-with-javascript/canavas_100609/"><img class="alignnone size-full wp-image-606" title="Venu" src="http://www.wisecodes.com/wp-content/uploads/2009/06/Canavas_100609.JPG" alt="Venu" width="439" height="311" /></a></p>
<h4><strong>How it works?</strong></h4>
<p>To do this we need to work only 2 files in our <strong>&lt;</strong><strong>head /&gt;</strong></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p602code7'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p6027"><td class="code" id="p602code7"><pre class="html" style="font-family:monospace;">&lt;script type=&quot;text/javascript&quot; src=&quot;dat.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;detector.js&quot;&gt;&lt;/script&gt;</pre></td></tr></table></div>

<p>Dat.js the file shows how to detect and detector.js the file has the logic of the script can detect faces in any photo.<br />
1 can detect faces in the photos, the process becomes slower depending on what we choose (of course).</p>
<h4>1 Face</h4>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p602code8'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p6028"><td class="code" id="p602code8"><pre class="javascript" style="font-family:monospace;">face_detect_one<span style="color: #009900;">&#40;</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;myCanvas&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h4><strong>Multiple Faces</strong></h4>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p602code9'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p6029"><td class="code" id="p602code9"><pre class="javascript" style="font-family:monospace;">face_detect_multi<span style="color: #009900;">&#40;</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;myCanvas&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">,</span> progress_callback<span style="color: #339933;">,</span> result_callback <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">function</span> progress_callback<span style="color: #009900;">&#40;</span> StepsCompleted<span style="color: #339933;">,</span> TotalSteps<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
....
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<h4><strong>Answer</strong></h4>
<p>The response functions that returns the values we obtain a rectangle that contains the person&#8217;s face.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p602code10'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p60210"><td class="code" id="p602code10"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> myCanvas <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;mycanvas&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> result <span style="color: #339933;">=</span> face_detect_one<span style="color: #009900;">&#40;</span> myCanvas <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>result<span style="color: #009900;">&#41;</span> draw_rect<span style="color: #009900;">&#40;</span>result<span style="color: #339933;">,</span> myCanvas<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> draw_rect<span style="color: #009900;">&#40;</span>r<span style="color: #339933;">,</span> myCanvas<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> CanvasContext <span style="color: #339933;">=</span> myCanvas.<span style="color: #660066;">getContext</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;2d&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 	CanvasContext.<span style="color: #660066;">strokeRect</span><span style="color: #009900;">&#40;</span> r.<span style="color: #660066;">x</span><span style="color: #339933;">,</span> r.<span style="color: #660066;">y</span><span style="color: #339933;">,</span> r.<span style="color: #660066;">w</span><span style="color: #339933;">,</span> r.<span style="color: #660066;">w</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Link: <a href="http://blog.kpicturebooth.com/?p=8" target="_blank">via Percobaan</a></p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.wisecodes.com/2009/06/detection-of-faces-on-canvas-with-javascript/" target="_blank"><img src="http://www.wisecodes.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.wisecodes.com/2009/06/detection-of-faces-on-canvas-with-javascript/" target="_blank" title="Share on Facebook">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.wisecodes.com/2009/06/detection-of-faces-on-canvas-with-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

