<?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>Pro-Tek Blog &#187; JS</title>
	<atom:link href="http://www.pro-tekconsulting.com/blog/category/js/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pro-tekconsulting.com/blog</link>
	<description>For UI developers / UI designers and UI trends</description>
	<lastBuildDate>Thu, 05 Sep 2019 03:59:47 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.0.34</generator>
	<item>
		<title>WHAT IS THE DIFFERENCE BETWEEN JQUERY AND D3.JS?</title>
		<link>http://www.pro-tekconsulting.com/blog/what-is-the-difference-between-jquery-and-d3-js/</link>
		<comments>http://www.pro-tekconsulting.com/blog/what-is-the-difference-between-jquery-and-d3-js/#comments</comments>
		<pubDate>Thu, 04 May 2017 03:11:07 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[jQuery and d3.js]]></category>

		<guid isPermaLink="false">http://www.pro-tekconsulting.com/blog/?p=1979</guid>
		<description><![CDATA[<p>What is the difference between jQuery and d3.js? &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;</p>
<p>The post <a rel="nofollow" href="http://www.pro-tekconsulting.com/blog/what-is-the-difference-between-jquery-and-d3-js/">WHAT IS THE DIFFERENCE BETWEEN JQUERY AND D3.JS?</a> appeared first on <a rel="nofollow" href="http://www.pro-tekconsulting.com/blog">Pro-Tek Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[<h4>What is the difference between jQuery and d3.js?</h4>
<p><img class="aligncenter wp-image-1980 size-full" src="http://www.pro-tekconsulting.com/blog/wp-content/uploads/2017/05/jQuery-and-d3-js.png" alt="jQuery and d3-js" width="721" height="224" /><br />
&nbsp;<br />
&nbsp;<br />
&nbsp;<br />
&nbsp;<br />
&nbsp;<br />
&nbsp;<br />
&nbsp;<br />
&nbsp;<br />
&nbsp;</p>
<p>The post <a rel="nofollow" href="http://www.pro-tekconsulting.com/blog/what-is-the-difference-between-jquery-and-d3-js/">WHAT IS THE DIFFERENCE BETWEEN JQUERY AND D3.JS?</a> appeared first on <a rel="nofollow" href="http://www.pro-tekconsulting.com/blog">Pro-Tek Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pro-tekconsulting.com/blog/what-is-the-difference-between-jquery-and-d3-js/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EXPLAIN &#8220;DEFERREDS&#8221;?</title>
		<link>http://www.pro-tekconsulting.com/blog/explain-deferreds/</link>
		<comments>http://www.pro-tekconsulting.com/blog/explain-deferreds/#comments</comments>
		<pubDate>Thu, 13 Aug 2015 04:37:43 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[AngularJS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Java Script]]></category>

		<guid isPermaLink="false">http://www.pro-tekconsulting.com/blog/?p=972</guid>
		<description><![CDATA[<p>Explain &#8220;Deferreds&#8221;? In their simplest form, deferreds allow you to specify what will occur when a computation/task completes or fails. jQuery&#8217;s specific implementation allows you to register callback functions that will run if a deferred resolves successfully, if it is rejected with errors, or if it is notified of some &#8220;progress&#8221; towards a resolved state [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://www.pro-tekconsulting.com/blog/explain-deferreds/">EXPLAIN &#8220;DEFERREDS&#8221;?</a> appeared first on <a rel="nofollow" href="http://www.pro-tekconsulting.com/blog">Pro-Tek Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[<h4>Explain &#8220;Deferreds&#8221;?</h4>
<p><img class="aligncenter size-full wp-image-973" src="http://www.pro-tekconsulting.com/blog/wp-content/uploads/2015/08/Deferreds.jpg" alt="Deferreds" width="791" height="566" /></p>
<ul>
<li style="text-align: justify;">In their simplest form, deferreds allow you to specify what will occur when a computation/task completes or fails. jQuery&#8217;s specific implementation allows you to register callback functions that will run if a deferred resolves successfully, if it is rejected with errors, or if it is notified of some &#8220;progress&#8221; towards a resolved state (more on that later).</li>
<li style="text-align: justify;">The &#8220;Deferred&#8221; pattern describes an object which acts as a proxy for some unit of computation that may or may not have completed.</li>
<li style="text-align: justify;">The pattern can apply to any asynchronous process: AJAX requests, animations or web workers to name a few.</li>
</ul>
<p><strong>Important to understand:</strong></p>
<ul>
<li style="text-align: justify;">Deferreds can be passed around indefinitely, and callbacks can continue to be added during the entire lifetime of the deferred object.</li>
<li style="text-align: justify;">The key to this behavior is callbacks registered with the deferred will run immediately if the deferred is already resolved.</li>
<li style="text-align: justify;">You don&#8217;t need to worry if the asynchronous unit of computation (e.g. an AJAX request) is finished or not.</li>
</ul>
<p>The post <a rel="nofollow" href="http://www.pro-tekconsulting.com/blog/explain-deferreds/">EXPLAIN &#8220;DEFERREDS&#8221;?</a> appeared first on <a rel="nofollow" href="http://www.pro-tekconsulting.com/blog">Pro-Tek Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pro-tekconsulting.com/blog/explain-deferreds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EVENT DELEGATION SIMPLIFIED?</title>
		<link>http://www.pro-tekconsulting.com/blog/event-delegation-simplified-2/</link>
		<comments>http://www.pro-tekconsulting.com/blog/event-delegation-simplified-2/#comments</comments>
		<pubDate>Thu, 13 Aug 2015 04:12:47 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[JS]]></category>

		<guid isPermaLink="false">http://www.pro-tekconsulting.com/blog/?p=967</guid>
		<description><![CDATA[<p>Event delegation simplified? First let’s understand few terms in Event model in JS. When an event is trigged on an element (say a click on a button), then such event goes UP to all it’s ancestors elements and triggers “click” on all of button’s parents. &#60;body onclick=”alert(“I am the body”)&#62; &#60;section onclick=”alert(“I am a section”)&#62; [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://www.pro-tekconsulting.com/blog/event-delegation-simplified-2/">EVENT DELEGATION SIMPLIFIED?</a> appeared first on <a rel="nofollow" href="http://www.pro-tekconsulting.com/blog">Pro-Tek Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[<h4>Event delegation simplified?</h4>
<ul>
<li style="text-align: justify;">First let’s understand few terms in Event model in JS. When an event is trigged on an element (say a click on a button), then such event goes UP to all it’s ancestors elements and triggers “click” on all of button’s parents.</li>
</ul>
<p style="text-align: left;">&lt;body onclick=”alert(“I am the body”)&gt;<br />
&lt;section onclick=”alert(“I am a section”)&gt;<br />
&lt;div&gt;<br />
&lt;button onclick=”alert(“I am a button”)&gt;-<br />
Click Me&lt;/button&gt;<br />
&lt;/div&gt;<br />
&lt;/section&gt;<br />
&lt;/body&gt;</p>
<p style="text-align: justify;">Clicking on the button will show up 3 alert boxes in the following order:</p>
<p>I am a button<br />
I am a Section<br />
I am the body</p>
<p style="text-align: justify;">Whether an onclick is attached on each of it’s ancestors elements or not, the “click” event is fired on each of them. This is event bubbling. The “clicked” element (in this case button) is stored in ‘target’ property of the event object.</p>
<p><strong>Now the event delegation:</strong></p>
<ul>
<li>Let’s say that we wanted to have a click event to each list item &lt;li&gt; element below. Instead of adding an event to each &lt;li&gt; element, we add the event at the parent level (ul in this case). The reason is that whenever a list item is clicked, the event bubbles up to top of DOM tree. When this happens, we can capture the event at UL (event bubbling) and easily determine from which element the event originated and perform the functionality to that element.</li>
</ul>
<p>&lt;ul id=&#8221;parent-list&#8221;&gt;<br />
&lt;li id=&#8221;post-1&#8243;&gt;Item 1&lt;/li&gt;<br />
&lt;li id=&#8221;post-2&#8243;&gt;Item 2&lt;/li&gt;<br />
&lt;li id=&#8221;post-3&#8243;&gt;Item 3&lt;/li&gt;<br />
&lt;li id=&#8221;post-4&#8243;&gt;Item 4&lt;/li&gt;<br />
&lt;li id=&#8221;post-5&#8243;&gt;Item 5&lt;/li&gt;<br />
&lt;li id=&#8221;post-6&#8243;&gt;Item 6&lt;/li&gt;<br />
&lt;/ul&gt;</p>
<ul>
<li style="text-align: justify;">When the event bubbles up to the UL element, you check the event object&#8217;s target property to gain a reference to the actual clicked node.</li>
<li style="text-align: justify;">JS Example</li>
</ul>
<p>// Get the element, add a click listener&#8230;<br />
document.getElementById(&#8220;parent-list&#8221;).addEventListener(&#8221;<br />
click&#8221;,function(e){<br />
// e.target is the clicked element!<br />
// If it was a list item<br />
if(e.target &amp;&amp; e.target.nodeName ==&#8221;LI&#8221;){<br />
// List item found! Output the ID!<br />
console.log(&#8220;List item &#8220;, e.target.id.replace(&#8221;<br />
post-&#8220;),&#8221; was clicked!&#8221;);<br />
}<br />
});</p>
<p>The post <a rel="nofollow" href="http://www.pro-tekconsulting.com/blog/event-delegation-simplified-2/">EVENT DELEGATION SIMPLIFIED?</a> appeared first on <a rel="nofollow" href="http://www.pro-tekconsulting.com/blog">Pro-Tek Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pro-tekconsulting.com/blog/event-delegation-simplified-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Do we repopulate or recreate the view in backbone or just get rid of the objects?</title>
		<link>http://www.pro-tekconsulting.com/blog/do-we-repopulate-or-recreate-the-view-in-backbone-or-just-get-rid-of-the-objects/</link>
		<comments>http://www.pro-tekconsulting.com/blog/do-we-repopulate-or-recreate-the-view-in-backbone-or-just-get-rid-of-the-objects/#comments</comments>
		<pubDate>Fri, 29 May 2015 04:01:50 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[JS]]></category>
		<category><![CDATA[BACKBONE.JS]]></category>

		<guid isPermaLink="false">http://www.pro-tekconsulting.com/blog/?p=735</guid>
		<description><![CDATA[<p>Do we repopulate or recreate the view in backbone or just get rid of the objects? It all depends on the Backbone application an individual is creating. We have to take into consideration of the lifespan of the objects created or involved. Because if the scope of the object is going to be for the [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://www.pro-tekconsulting.com/blog/do-we-repopulate-or-recreate-the-view-in-backbone-or-just-get-rid-of-the-objects/">Do we repopulate or recreate the view in backbone or just get rid of the objects?</a> appeared first on <a rel="nofollow" href="http://www.pro-tekconsulting.com/blog">Pro-Tek Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[<h4>Do we repopulate or recreate the view in backbone or just get rid of the objects?</h4>
<p style="text-align: justify;">It all depends on the Backbone application an individual is creating. We have to take into consideration of the lifespan of the objects created or involved. Because if the scope of the object is going to be for the entire application, then it is better not to kill the objects, which are going to be used. And it is better to delete the one’s which are of local scope / temporary. Also, repopulating the view in backbone suits well in the case when the data objects are dynamic (like just a data-refresh).</p>
<p>The post <a rel="nofollow" href="http://www.pro-tekconsulting.com/blog/do-we-repopulate-or-recreate-the-view-in-backbone-or-just-get-rid-of-the-objects/">Do we repopulate or recreate the view in backbone or just get rid of the objects?</a> appeared first on <a rel="nofollow" href="http://www.pro-tekconsulting.com/blog">Pro-Tek Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pro-tekconsulting.com/blog/do-we-repopulate-or-recreate-the-view-in-backbone-or-just-get-rid-of-the-objects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What&#8217;s the difference between .call and .apply?</title>
		<link>http://www.pro-tekconsulting.com/blog/whats-the-difference-between-call-and-apply/</link>
		<comments>http://www.pro-tekconsulting.com/blog/whats-the-difference-between-call-and-apply/#comments</comments>
		<pubDate>Wed, 06 May 2015 05:17:13 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[JS]]></category>
		<category><![CDATA[.apply]]></category>
		<category><![CDATA[.call]]></category>

		<guid isPermaLink="false">http://www.pro-tekconsulting.com/blog/?p=656</guid>
		<description><![CDATA[<p>What&#8217;s the difference between .call and .apply? Call( ) and Apply( ) in JS is most commonly used to invoke a method or used in constructors &#38; classes for Inheritance purposes. The first parameter to be passed in these two methods is an Object (current reference/current context). The difference comes in the concluding parameters. Apply( [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://www.pro-tekconsulting.com/blog/whats-the-difference-between-call-and-apply/">What&#8217;s the difference between .call and .apply?</a> appeared first on <a rel="nofollow" href="http://www.pro-tekconsulting.com/blog">Pro-Tek Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[<h4>What&#8217;s the difference between .call and .apply?</h4>
<p style="text-align: justify;">Call( ) and Apply( ) in JS is most commonly used to invoke a method or used in constructors &amp; classes for Inheritance purposes.</p>
<p style="text-align: justify;">The first parameter to be passed in these two methods is an Object (current reference/current context). The difference comes in the concluding parameters.</p>
<p style="text-align: justify;">Apply( ) takes Array as it&#8217;s next parameter. The array represents the arguments for the target method.</p>
<p style="text-align: justify;">Call( ) takes arguments in comma separated format.</p>
<p><strong>Usage:</strong><br />
Use apply ( ), if you don&#8217;t know the number of arguments you will be passing, or if they are already in an array.<br />
With call ( ), you can write a method once and then inherit it in another object, without having to rewrite the method for the new object.</p>
<p>The post <a rel="nofollow" href="http://www.pro-tekconsulting.com/blog/whats-the-difference-between-call-and-apply/">What&#8217;s the difference between .call and .apply?</a> appeared first on <a rel="nofollow" href="http://www.pro-tekconsulting.com/blog">Pro-Tek Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pro-tekconsulting.com/blog/whats-the-difference-between-call-and-apply/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
