<?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>Dušan Gledović&#039;s</title>
	<atom:link href="http://gledovic.com/feed" rel="self" type="application/rss+xml" />
	<link>http://gledovic.com</link>
	<description>Read, test and research logs with no rants at all.</description>
	<lastBuildDate>Tue, 01 May 2012 22:32:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>The Notes on JavaScript &#8211; part 1</title>
		<link>http://gledovic.com/javascript-notes-1</link>
		<comments>http://gledovic.com/javascript-notes-1#comments</comments>
		<pubDate>Sun, 22 Apr 2012 22:30:37 +0000</pubDate>
		<dc:creator>Dusan Gledovic</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[BOM]]></category>
		<category><![CDATA[Browser Object Model]]></category>
		<category><![CDATA[Document Object Model]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://gledovic.com/?p=362</guid>
		<description><![CDATA[JavaScript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles. - Wikipedia JavaScript and ECMAScript are usually considered as being synonyms, but ECMAScript is basically JavaScript subset. Complete JavaScript implementation consists of: The Core (ECMAScript) The Document Object Model (DOM) The [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p><strong>JavaScript</strong> is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles.<br />
- Wikipedia</p></blockquote>
<p>JavaScript and ECMAScript are usually considered as being synonyms, but <a title="Standard ECMA-262 ECMAScript Language Specification" href="http://www.ecma-international.org/publications/standards/Ecma-262.htm" target="_blank">ECMAScript</a> is basically JavaScript subset.</p>
<p><span id="more-362"></span></p>
<p>Complete JavaScript implementation consists of:</p>
<ul>
<li>The Core (ECMAScript)</li>
<li>The Document Object Model (DOM)</li>
<li>The Browser Object Model (BOM)</li>
</ul>
<h2>ECMAScript</h2>
<p>ECMAScript language is language described in <a title="Standard ECMA-262 ECMAScript Language Specification" href="http://www.ecma-international.org/publications/standards/Ecma-262.htm" target="_blank">ECMA-262 specification</a> which latest edition 5.1 is released in June 2011.</p>
<p>ECMAScript is script language serving as a base on which more powerful scripting languages can be built through extensions. Most often those languages are implemented in host environments and functionality of the extensions are specific to the environments.</p>
<p>Web browsers are one kind of host environment with JavaScript implementation which, as mentioned above, consists of ECMAScript, <abbr title="The Document Object Model">DOM</abbr> and <abbr title="The Browser Object Model">BOM</abbr>.</p>
<table>
<caption>ECMAScript support in popular web browsers</caption>
<thead>
<tr>
<td>Browser</td>
<td>ECMAScript Compliance</td>
</tr>
</thead>
<tbody>
<tr>
<td>Netscape 6+ (Mozilla 0.6.0+)</td>
<td>Edition 3</td>
</tr>
<tr>
<td>Firefox 1–2</td>
<td>Edition 3</td>
</tr>
<tr>
<td>Firefox 3.0.x</td>
<td>Edition 3</td>
</tr>
<tr>
<td>Firefox 3.5–3.6</td>
<td>Edition 5 *</td>
</tr>
<tr>
<td>Firefox 4+</td>
<td>Edition 5</td>
</tr>
<tr>
<td>Internet Explorer 5.5–7</td>
<td>Edition 3</td>
</tr>
<tr>
<td>Internet Explorer 8</td>
<td>Edition 5 *</td>
</tr>
<tr>
<td>Internet Explorer 9+</td>
<td>Edition 5</td>
</tr>
<tr>
<td>Opera 7.2+</td>
<td>Edition 3</td>
</tr>
<tr>
<td>Safari 1–2.0.x</td>
<td>Edition 3 *</td>
</tr>
<tr>
<td>Safari 3.x</td>
<td>Edition 3</td>
</tr>
<tr>
<td>Safari 4.x–5.x</td>
<td>Edition 5 *</td>
</tr>
<tr>
<td>Chrome 1+</td>
<td>Edition 3</td>
</tr>
</tbody>
</table>
<p>* Incomplete implementations</p>
<h2>The Document Object Model (DOM)</h2>
<blockquote><p>The DOM is an application programming interface (API) for valid HTML and well-formed XML documents. It defines the logical structure of documents and the way a document is accessed and manipulated<br />
- W3C</p></blockquote>
<p>The DOM maps out an entire page as a three like hierarchy of nodes. Each part of an HTML page is a type of a node containing other nodes or data.</p>
<p>The DOM allows developers to manipulate its content and structure. Nodes can be removed, added, replaced, and modified by using the DOM API.</p>
<h3>DOM Levels</h3>
<p>DOM Levels represent W3C recommendations for the DOM implementations. There have been 3 DOM level recommendations so far (<a title="DOM4 W3C Working Draft" href="http://www.w3.org/TR/dom/" target="_blank">DOM4</a> underway). The DOM is not JavaScript-specific. It has been implemented in other languages, as well. Nevertheless, it makes up a large part of the JavaScript language.</p>
<h4>DOM Level 1</h4>
<p>DOM Level 1 came to existence in 1998. It consists of two modules:</p>
<ul>
<li><strong>DOM Core</strong> &#8211; provides minimal set of objects and interfaces for accessing and manipulating parsed HTML and XML documents (document objects).</li>
<li><strong>DOM HTML</strong> &#8211; extends the DOM Core to describe objects and methods specific to HTML documents.</li>
</ul>
<h4>DOM Level 2</h4>
<p>DOM level 2, besides upgrading the DOM Core 1 and DOM HTML 1, introduced four new DOM modules to deal with new types of interfaces:</p>
<ul>
<li><strong>DOM Views </strong>- defines interfaces that allows programs and scripts to access and update a content of a document.</li>
<li><strong>DOM Events -</strong> defines interfaces for events and event handling (generic event system for programs and scripts).</li>
<li><strong>DOM Style </strong>- defines interfaces that allows programs and scripts to dynamically access and update the content of style sheets.</li>
<li><strong>DOM Traversal and Range </strong>- defines interfaces to traverse and manipulate nodes in a document tree.</li>
</ul>
<h4>DOM Level 3</h4>
<p>The DOM Level 3 further extended the DOM2 Core (support for all of XML 1.0) and DOM2 Events (added keyboard events and handling). Also, DOM3 added following modules:</p>
<ul>
<li><strong>DOM3 Load and Save</strong> - defines a set of interfaces for loading and saving document objects.</li>
<li><strong>DOM3 Validation</strong> - defines a way to dynamically update content and structure of a document while ensuring that the document remains valid. Guided construction and editing of the (XML) documents.</li>
<li><strong>DOM3 XPath</strong> - defines API for accessing DOM tree by XPath expressions.</li>
</ul>
<p>Like JavaScript, other languages (like XML-based Scalable Vector Graphics &#8211; SVG 1.0, Mathematical Markup Language &#8211; MathML 1.0, Synchronized Multimedia Integration Language &#8211; SMIL, Mozilla&#8217;s XML User Interface Language &#8211; XUL) also may have their own DOM implementations.</p>
<table>
<caption>DOM levels support in popular web browsers</caption>
<thead>
<tr>
<td>Browser</td>
<td>DOM Compliance</td>
</tr>
</thead>
<tbody>
<tr>
<td>Netscape 6+ (Mozilla 0.6.0+)</td>
<td>Level 1, Level 2*, Level 3**</td>
</tr>
<tr>
<td>Firefox 1+</td>
<td>Level 1, Level 2*, Level 3**</td>
</tr>
<tr>
<td>Internet Explorer 5.5–8</td>
<td>Level 1*</td>
</tr>
<tr>
<td>Internet Explorer 9+</td>
<td>Level 1, Level 2, Level 3</td>
</tr>
<tr>
<td>Opera 9–9.9</td>
<td>Level 1, Level 2*, Level 3**</td>
</tr>
<tr>
<td>Opera 10+</td>
<td>Level 1, Level 2, Level 3**</td>
</tr>
<tr>
<td>Safari 1</td>
<td>Level 1</td>
</tr>
<tr>
<td>Safari 2+</td>
<td>Level 1, Level 2**</td>
</tr>
<tr>
<td>Chrome 1+</td>
<td>Level 1, Level 2**</td>
</tr>
</tbody>
</table>
<p>* almost all<br />
** partial</p>
<h2><strong>The Browser Object Model (BOM)</strong></h2>
<p>Browser Object Model (BOM) is interface that allows access and manipulation of the browser window and access to the computer screen. BOM refers to all the objects exposed as extensions to JavaScript by the web browser as its host environment.</p>
<p>Before HTML5 BOM had no standard it relates to, which led to situation in which each browser has its own implementation of the BOM. Now HTML5 should make the BOM more compatible throughout browsers landscape. Still, even now, there is a subset of the BOM that exists in every browser environment. Some of the objects found in this cross-browser BOM subset are:</p>
<ul>
<li><strong>browser capabilities</strong> to open (pop up) new browser windows, to move, resize, and close them</li>
<li><strong>The navigator object</strong> &#8211; provides information on the browser and its capabilities</li>
<li><strong>The location object</strong> &#8211; provides information about URL of the currently loaded page in the browser</li>
<li><strong>The screen object</strong> &#8211; provides information about the screen outside of the browser</li>
<li><strong>The frames object</strong> &#8211; provides access to all frames and iframes of the current page</li>
<li><strong>The history object</strong> &#8211; provides access (though limited) to the previously visited pages</li>
<li><strong>The XMLHttpRequest and IE’s ActiveXObject objects</strong> - Ajax interactions backbones</li>
<li><strong>cookie support</strong> etc.</li>
</ul>
<h2>Pick ups</h2>
<p>JavaScript is a scripting language made of:</p>
<ul>
<li><strong>ECMAScript</strong>, provides core functionality and it is based on <a title="Standard ECMA-262 ECMAScript Language Specification" href="http://www.ecma-international.org/publications/standards/Ecma-262.htm" target="_blank">ECMA-262 specification</a></li>
<li><strong>The DOM</strong>, provides methods and interfaces for working with the content of a web page</li>
<li><strong>The BOM</strong>, provides methods and interfaces for interacting with the browser and the computer screen</li>
</ul>
<p>Levels of support for these three JavaScript parts differs across the web browsers, but substantial subset of each is implemented with ECMAScript leading the way.</p>
<h3>Bibliography:</h3>
<ul>
<li><a title="Professional JavaScript for Web Developers 3rd Edition book page" href="http://www.wrox.com/WileyCDA/WroxTitle/Professional-JavaScript-for-Web-Developers-3rd-Edition.productCd-1118222199.html" target="_blank">Professional JavaScript for Web Developers</a> by <a title="Nicholas C. Zakas website" href="http://www.nczonline.net/" target="_blank">Nicholas C. Zakas</a></li>
<li><a title="Object-Oriented JavaScript book page" href="http://www.packtpub.com/object-oriented-javascript/book" target="_blank">Object Oriented JavaScript</a> by <a title="Stoyan Stefanov website" href="http://www.phpied.com/" target="_blank">Stoyan Stefanov</a></li>
<li>
<div><a title="JavaScript: The Good Parts book page" href="http://shop.oreilly.com/product/9780596517748.do" target="_blank">JavaScript: The Good Parts</a> by <a title="Douglas Crockford website" href="http://www.crockford.com/" target="_blank">Douglas Crockford</a></div>
</li>
<li><a title="Mozilla Developer Network link" href="https://developer.mozilla.org/en-US/" target="_blank">Mozilla Developer Network</a></li>
<li><a title="Wikipedia in English home page" href="http://en.wikipedia.org/wiki/Main_Page" target="_blank">Wikipedia</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://gledovic.com/javascript-notes-1/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ignore files with .gitignore file and global .gitignore for Eclipse/Zend Studio project files</title>
		<link>http://gledovic.com/ignore-files-with-gitignore-and-global-gitignore</link>
		<comments>http://gledovic.com/ignore-files-with-gitignore-and-global-gitignore#comments</comments>
		<pubDate>Thu, 22 Mar 2012 02:40:58 +0000</pubDate>
		<dc:creator>Dusan Gledovic</dc:creator>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[Version Control]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[version control]]></category>

		<guid isPermaLink="false">http://gledovic.com/?p=283</guid>
		<description><![CDATA[Every now and then you have to set some files to be ignored in you Git repository, so that they do not get in your way, to stop making &#8220;noise&#8221; in your workflow. Three ways to tell a Git to ignore certain files Git ignore the Zend Studio way If you are using Zend Studio [...]]]></description>
			<content:encoded><![CDATA[<p>Every now and then you have to set some files to be ignored in you Git repository, so that they do not get in your way, to stop making &#8220;noise&#8221; in your workflow.</p>
<h2>Three ways to tell a Git to ignore certain files</h2>
<h3>Git ignore the Zend Studio way</h3>
<p>If you are using Zend Studio 9 with Git plugin that comes with it you should right click file you want ignored, hover over Team option in menu and select Ignore submenu (see picture below). This basically creates .gitignore file in root of the current project and sets file name of the file to be ignored in it or appends it to the file if one already exists.</p>
<p><span id="more-283"></span></p>
<p><img class="alignnone size-full wp-image-285" style="margin: 15px 0;" title="Set Git to ignore file through Zend Studio" src="http://gledovic.com/wp-content/uploads/2012/03/zend_studio_gitignore.png" alt="Screenshot showing how to tell a Git to ignore file through Zend Studio" width="670" height="372" /></p>
<h3>Git ignore the .gitignore file way</h3>
<p>.gitignore file should be set in the root of a project and can be commited to be shared with other collaborators on the project.<br />
In the file should be listed files to be ignored and there are some rules:</p>
<pre class="brush: plain; title: ; notranslate">

# Lines starting with '#' are considered comments.
# Ignore any file named foo.txt.
foo.txt
# Ignore (generated) html files,
*.html
# except foo.html which is maintained by hand.
!foo.html
# Ignore objects and archives.
*.[oa]
</pre>
<h3>The global Git ignore</h3>
<p>There are some files which should be ignored forever and in every single project IMO, like Zend Studio/Eclipse project settings.</p>
<p>For those there is a option of setting global .gitignore file.</p>
<ol>
<li>make .gitignore_global (could be named whatever you find suitable) file and place it in a convenient place. I set it in the root folder which holds all projects I work on.</li>
<li>add/register it to your global git config like this:<br />
git config &#8211;global core.excludesfile /path_you_chose/.gitignore_global</li>
<li>add files to be ignored globally:</li>
</ol>
<pre class="brush: plain; title: ; notranslate">

# Zend Studio files #
#####################
.buildpath
.project
.settings*
</pre>
<p>Become a Git ignore guru (: by researching resources in bibliography section below and most of all enjoy ignoring or better by following this <a title="Guide to Version Control Systems (hub page)" href="http://gledovic.com/guide-to-version-control-systems-hub">guide on Version Control and Git</a>.</p>
<p>Bibliography:</p>
<ul>
<li><a title="gitignore(5) Manual Page" href="http://schacon.github.com/git/gitignore.html" target="_blank">gitignore(5) Manual Page</a></li>
<li><a title="Git Ignore files on Github" href="http://help.github.com/ignore-files/" target="_blank">Git Ignore files on Github</a></li>
<li><a title="Ignoring files in Git Community book" href="http://book.git-scm.com/4_ignoring_files.html" target="_blank">Ignoring files in Git Community book</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://gledovic.com/ignore-files-with-gitignore-and-global-gitignore/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Guide to Version Control Systems (hub)</title>
		<link>http://gledovic.com/guide-to-version-control-systems-hub</link>
		<comments>http://gledovic.com/guide-to-version-control-systems-hub#comments</comments>
		<pubDate>Thu, 22 Mar 2012 02:32:29 +0000</pubDate>
		<dc:creator>Dusan Gledovic</dc:creator>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[Version Control]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[version control]]></category>

		<guid isPermaLink="false">http://gledovic.com/?p=310</guid>
		<description><![CDATA[Disclaimer: this is guide for few of my friends, but you can use it for your self with no strings attached (:. Version control system is must for every working developer. They are great time savers and must in every team environment, even in one man show teams (you just have to put your self [...]]]></description>
			<content:encoded><![CDATA[<p>Disclaimer: this is guide for few of my friends, but you can use it for your self with no strings attached (:.</p>
<p>Version control system is must for every working developer. They are great time savers and <strong>must</strong> in every team environment, even in one man show teams (you just have to put your self together from time to time (: ).</p>
<p>Me, I prefer Git, but, at the moment, I am using SVN at work on daily basis.</p>
<p>Anyway, there are great resources around www you can use to get up to speed with Git and version control in general.</p>
<h2>Starting point in using version control</h2>
<p>Getting to know basics behind the idea of version control is starting point on your way to start using one.</p>
<p><span id="more-310"></span></p>
<p>Following resources will give you enough information so you can justify to yourself why are you spending time learning another technology (-: :</p>
<ol>
<li><a title="Wikipedia article on Revision Control" href="http://en.wikipedia.org/wiki/Revision_control" target="_blank">Wikipedia article about revision control</a> &#8211; to get general ideas behind version control systems.</li>
<li title="A visual guide to version control"><a title="A visual guide to version control" href="http://betterexplained.com/articles/a-visual-guide-to-version-control/" target="_blank">A visual guide to version control</a> &#8211; traditional (centralized) version control systems explained.</li>
<li><a title="Intro to Distributed Version Control (Illustrated)" href="http://betterexplained.com/articles/intro-to-distributed-version-control-illustrated/" target="_blank">Intro to Distributed Version Control (Illustrated)</a> &#8211; distributed version control system explained.</li>
</ol>
<p>After those resources mention above you have all you need to start appreciating version control systems and be thrilled to get to learning Git.</p>
<h2>Getting experience with Git</h2>
<p>Now you need to start using one of the concrete tools. Go with the Git.</p>
<p>This tutorial will get you up and running:</p>
<ul>
<li><a title="Easy Version Control with Git " href="http://net.tutsplus.com/tutorials/other/easy-version-control-with-git/" target="_blank">Easy Version Control with Git</a> &#8211; intro tutorial that should set on your way to using Git.</li>
</ul>
<p>After studying above resource you should have a enough Git skills to start using it in your projects and following resource will be your crouches for the long period of time (-: :</p>
<ul>
<li><a title="Git User’s Manual " href="http://schacon.github.com/git/user-manual.html" target="_blank">Git User’s Manual</a></li>
</ul>
<p>But, one day ((-:, my man, you will start walking.</p>
<h2>More great resources on Git</h2>
<ul>
<li><a title="Git - the fast version control system official page" href="http://git-scm.com/" target="_blank">Official Git page</a></li>
<li><a title="Great video to master Git and workflow" href="http://excess.org/article/2008/07/ogre-git-tutorial/" target="_blank">Great video to master Git and workflow</a> by <a title="Homepage of Bart Trojanowski" href="http://www.jukie.net/%7Ebart/" target="_blank">Bart Trojanowski</a></li>
<li><a title="Git Community Book" href="http://book.git-scm.com/index.html" target="_blank">Community made book on Git</a></li>
<li><a title="Pro Git free book by Apress" href="http://progit.org/book/" target="_blank">Pro Git &#8211; free book by Apress</a></li>
</ul>
<h2>Git in the cloud</h2>
<p><strong>Disclaimer 2:</strong> spare yourself and do not bother with these for some time if you are beginner. Give yourself time to get comfortable with Git in local first.</p>
<p>It was said to me that one is not considered serious developer if one is not having <a title="Github" href="https://github.com/" target="_blank">Github</a> account (and using it, I guess), but I prefer using <a title="Bitbucket - the Git in the cloud" href="https://bitbucket.org/" target="_blank">Bitbucket</a>, which is basically the same as Github except that it offers <strong>unlimited private repositories for free</strong> while Github offers 0 (zero, nada).</p>
<p>Both of them, Bitbucket and Github, are great web services and helps distributed teams to collaborate without bothering with setting their own Git servers and infrastructure in general.</p>
<p>Take care and control your version.</p>
]]></content:encoded>
			<wfw:commentRss>http://gledovic.com/guide-to-version-control-systems-hub/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery solution for form submitting on enter &#8211; the event capturing/bubbling problem</title>
		<link>http://gledovic.com/form-is-not-submitting-on-enter-the-event-capturing-bubbling-problem-jquery-solution</link>
		<comments>http://gledovic.com/form-is-not-submitting-on-enter-the-event-capturing-bubbling-problem-jquery-solution#comments</comments>
		<pubDate>Fri, 27 May 2011 20:33:37 +0000</pubDate>
		<dc:creator>Dusan Gledovic</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[linkedin]]></category>

		<guid isPermaLink="false">http://gledovic.com/blog/?p=226</guid>
		<description><![CDATA[Problem with form not submitting when Enter is pressed has its background in implementation of event bubbling and/or event capturing. In Internet Explorer events bubbles, on the other hand in other browsers events are being captured and bubbled. Yay! You can read further on that matter in article on event order at quirksmode.org, which is [...]]]></description>
			<content:encoded><![CDATA[<p>Problem with form not submitting when Enter is pressed has its background in implementation of event bubbling and/or event capturing. In Internet Explorer events bubbles, on the other hand in other browsers events are being captured and bubbled. Yay!</p>
<p><span id="more-226"></span>You can read further on that matter in <a title="Event bubbling and capturing problem explained" href="http://www.quirksmode.org/js/events_order.html" target="_blank">article on event order</a> at <a title="QuirksMode - for all your browser quirks" href="http://www.quirksmode.org/" target="_blank">quirksmode.org</a>, which is great site and you should certainly spend some time over there if you already haven&#8217;t.</p>
<p>Let&#8217;s get down to the essence of this article, which is handling problem of form not submitting when Enter is pressed while some text input field has focus and solution you could find in jQuery.</p>
<p>You have and form:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;form id=&quot;signup&quot; action=&quot;/process/login-form&quot; method=&quot;post&quot;&gt;
  &lt;label for=&quot;answer1&quot;&gt;What are you think about blue?&lt;/label&gt;
  &lt;input id=&quot;answer1&quot; name=&quot;answer1&quot; type=&quot;text&quot; /&gt;
  &lt;input type=&quot;submit&quot; value=&quot;Answer&quot; /&gt;
&lt;/form&gt;
</pre>
<p>and it is bugged down (I have no idea if this phrase exists) as explained above, you are using jQuery (please, don&#8217;t use jQuery just to overcome this obstacle &#8211; it is non sense) and you are thinking about your solutions.</p>
<p>One of the solutions could be:</p>
<pre class="brush: jscript; title: ; notranslate">
	$(&quot;#answer1&quot;).keydown(function(event){
		if(event.keyCode == 13 &amp;&amp; jQuery.support.submitBubbles) {
			$(this).parents(&quot;form&quot;).submit();
		};
	})
</pre>
<p>What that code does is it binds keypress event to the input field of interest and checks on keypress (when that field has focus) if event code corresponds to the keyCode (13) of the Enter key and if it does it sends submit to the parent form, which could be called by its id, but this way you can address different input fields with same class from different forms, which is not rare on web today, to have a whole bunch of forms in one page.</p>
<p><a title="jQuery.support page in jQuery reference" href="http://api.jquery.com/jQuery.support/" target="_blank">jQuery.support object</a> is &#8220;A collection of properties that represent the presence of different browser features or bugs.&#8221; as it is said in <a title="Link to jQuery reference web site" href="http://api.jquery.com/" target="_blank">jQuery reference</a>. It relies on feature detection (not browser detection) which is recommended and  safer method.</p>
<p>I hope you find this article helpful.</p>
]]></content:encoded>
			<wfw:commentRss>http://gledovic.com/form-is-not-submitting-on-enter-the-event-capturing-bubbling-problem-jquery-solution/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Big and Little Endian Explained</title>
		<link>http://gledovic.com/big-and-little-endian-explained</link>
		<comments>http://gledovic.com/big-and-little-endian-explained#comments</comments>
		<pubDate>Fri, 04 Mar 2011 01:29:17 +0000</pubDate>
		<dc:creator>Dusan Gledovic</dc:creator>
				<category><![CDATA[Others]]></category>
		<category><![CDATA[computing]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://gledovic.com/blog/?p=213</guid>
		<description><![CDATA[I was looking for resource to refresh my memory on story of endians and stumbled upon this great post: Understanding big and little endian byte order I am really impressed how some people know to deliver such a great contribution to cyberspace. Bravo and thank you to the author Kalid Azad.]]></description>
			<content:encoded><![CDATA[<p>I was looking for resource to refresh my memory on story of endians and stumbled upon this great post:</p>
<p><a title="Understanding big and little endian byte order" href="http://betterexplained.com/articles/understanding-big-and-little-endian-byte-order/" target="_blank">Understanding big and little endian byte order</a></p>
<p>I am really impressed how some people know to deliver such a great contribution to cyberspace.</p>
<p>Bravo and thank you to the author Kalid Azad.</p>
]]></content:encoded>
			<wfw:commentRss>http://gledovic.com/big-and-little-endian-explained/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript Singleton Design Pattern Demystified</title>
		<link>http://gledovic.com/javascript-singleton-design-pattern-demystified</link>
		<comments>http://gledovic.com/javascript-singleton-design-pattern-demystified#comments</comments>
		<pubDate>Mon, 07 Feb 2011 18:29:11 +0000</pubDate>
		<dc:creator>Dusan Gledovic</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Object Oriented JavaScript]]></category>
		<category><![CDATA[design patterns]]></category>
		<category><![CDATA[javascript design patterns]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[object oriented javascript]]></category>

		<guid isPermaLink="false">http://gledovic.com/blog/?p=149</guid>
		<description><![CDATA[Singleton is one of the creational design patterns. It serve purpose of &#8220;restricting the instantiation of a class to one object&#8221;. (wikipedia) Because of its nature, JavaScript has different way of implementation of the Singleton Pattern than &#8220;traditional&#8221; object-oriented languages like Java, C#, PHP etc. To get proper Singleton implementation (in JavaScript) we have to [...]]]></description>
			<content:encoded><![CDATA[<p>Singleton is one of the <strong>creational design patterns</strong>. It serve purpose of &#8220;restricting the instantiation of a class to one object&#8221;. <sup><a href="http://en.wikipedia.org/wiki/Singleton_pattern">(wikipedia)</a></sup></p>
<p>Because of its nature, JavaScript has different way of implementation of the Singleton Pattern than &#8220;traditional&#8221; object-oriented languages like Java, C#, PHP etc.</p>
<p><span id="more-149"></span></p>
<p>To get proper Singleton implementation (in JavaScript) we have to fulfill following demands:</p>
<ul class="real_ul_list">
<li>once instantiated, attempt to instantiate same class again should actually return the first object</li>
<li>instance should not be rewritable</li>
</ul>
<pre class="brush: jscript; title: ; notranslate">
function Test() {
	// private
	var instance = this;

	// rest of the code

	// overwriting itself (constructor) from global space
	// so that following calls to new Test();
	// actually returns private variable instance
	Test = function () {
		return instance;
	};
}

obj1 = new Test();
obj2 = new Test();

obj1 === obj2 // result: true
</pre>
<p>This pattern uses power of closures to preserve global namespace from cluttering and instance from being overridden from that same space, the global one.</p>
<p>In above primer we have Test class. In it there is instantiated variable instance with var keyword so that it becomes private variable. Then <a href="http://en.wikipedia.org/wiki/This_%28computer_science%29">this</a> is assigned to it so that it could be called from inner functions and most of all inner Test function which will override its parent Test (because of the same name) constructor from global namespace once the parent gets instantiated.</p>
<p>That&#8217;s the reason obj1 and obj2 identity comparison returns true, because second call new Test() actually just returns instance variable. Keeping in mind that objects are passed by reference in JavaScript, it&#8217;s obvious that obj1 and obj2 are just different name pointing to the same address in memory.</p>
<pre class="brush: jscript; title: ; notranslate">
function Test() {
	// private
	var instance = this;

	// rest of the code
	// ...

	// private
	var oneVeryImportanFunction = function(){
		alert(typeof instance);
	}

	// public
	this.getType = function(){
            oneVeryImportanFunction();
	}

	// overwriting itself (constructor) from global space
	// so that following calls to new Test();
	// actually return private variable instance
	Test = function () {
		return instance;
	};
}

obj1 = new Test();
obj2 = new Test();

obj1 === obj2;

obj2.getType();
</pre>
<p>Usually, &#8220;By convention, we make a private that&#8221; = this &#8221; variable. This is used to make the object available to the private methods. This is a workaround for an error in the ECMAScript Language Specification which causes this to be set incorrectly for inner functions.&#8221; <sup><a href="http://javascript.crockford.com/private.html">crockford</a></sup> , but here in oneVeryImportanFunction() function we could use instance variable as it serves same thing like that, but it has different name.</p>
]]></content:encoded>
			<wfw:commentRss>http://gledovic.com/javascript-singleton-design-pattern-demystified/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Classical constructor function in JavaScript class</title>
		<link>http://gledovic.com/classical-constructor-function-in-javascript-class</link>
		<comments>http://gledovic.com/classical-constructor-function-in-javascript-class#comments</comments>
		<pubDate>Sat, 29 Jan 2011 01:32:12 +0000</pubDate>
		<dc:creator>Dusan Gledovic</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Object Oriented JavaScript]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[javascript constructor function]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[object oriented javascript]]></category>

		<guid isPermaLink="false">http://gledovic.com/blog/?p=43</guid>
		<description><![CDATA[I was in search (~5 min) for classical constructor for classes in JavaScript. What I found is nothing. It lasted too short, I guess, but anyway I did some tests and I got to the solution that could easily act as JavaScript class constructor. The complete Test class: And html: Output is of course: Dusan [...]]]></description>
			<content:encoded><![CDATA[<p>I was in search (~5 min) for classical constructor for classes in JavaScript. What I found is nothing. It lasted too short, I guess, but anyway I did some tests and I got to the solution that could easily act as JavaScript class constructor.</p>
<p><span id="more-43"></span></p>
<p>The complete Test class:</p>
<pre class="brush: jscript; title: ; notranslate">function Test(name){

	var that = this;

	var fname;

	var __construct = function(passedName){
		fname = passedName;
	}(name);

	this.getName = function(){
		return fname;
	};

	this.changeText = function(){
		document.getElementById(&quot;name&quot;).innerHTML = this.getName();
	}
}

var Test = new Test(&quot;Dusan&quot;);
Test.changeText();</pre>
<p>And html:</p>
<pre class="brush: xml; title: ; notranslate">&lt;html&gt;
	&lt;head&gt;
	&lt;/head&gt;
	&lt;body&gt;
		&lt;div id=&quot;name&quot;&gt;&lt;/div&gt;
	&lt;/body&gt;
&lt;/html&gt;</pre>
<p>Output is of course: Dusan</p>
<p>Whole point is within few lines of code:</p>
<pre class="brush: jscript; title: ; notranslate">var __construct = function(passedName){
	fname = passedName;
}(name);</pre>
<p>__construct is private self invoking function and it is passed name param during Test object construct. It sets fname var to name param value.</p>
<p>It could easily be something more complex like config object:</p>
<pre class="brush: jscript; title: ; notranslate">function Test(configObject){
	var __construct = function(params){
		fname = params[&quot;fname&quot;];
		lname= params[&quot;lname&quot;];
	}(configObject);</pre>
<p>This is anything, but a complex, but you got an idea.</p>
<h3>Notes:</h3>
<ul>
<li>You can name __construct function as you wish. I named it like this for clarity and because of my PHP roots. <img src='http://gledovic.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>__construct returns void so there is no possibility of revoking it. It becomes typeof &#8220;undefined&#8221;.</li>
<li>It has to be defined like <span style="background-color: ##f9f9f9;"> var chooseContructorName = function(){&#8230;} </span> to stay private and to parse as self invoking.</li>
</ul>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://gledovic.com/classical-constructor-function-in-javascript-class/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hello World</title>
		<link>http://gledovic.com/hello-world</link>
		<comments>http://gledovic.com/hello-world#comments</comments>
		<pubDate>Sat, 15 Jan 2011 02:23:55 +0000</pubDate>
		<dc:creator>Dusan Gledovic</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://gledovic.com/blog/?p=9</guid>
		<description><![CDATA[After ages of &#8220;having more important stuff at the moment&#8221;, I finally did it, in 5 minutes as WordPress crew brags about, I set up the blog on my site, instead of my old site from freelancing era. I am looking forward to logging my thoughts on web development, programming etc. It&#8217;ll be fun.]]></description>
			<content:encoded><![CDATA[<p>After ages of &#8220;having more important stuff at the moment&#8221;, I finally did it, in 5 minutes as WordPress crew brags about, I set up the blog on my site, instead of my old site from freelancing era.</p>
<p>I am looking forward to logging my thoughts on web development, programming etc.</p>
<p>It&#8217;ll be fun.</p>
]]></content:encoded>
			<wfw:commentRss>http://gledovic.com/hello-world/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

