<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: How JavaScript Works</title>
	<atom:link href="http://misko.hevery.com/2010/07/14/how-javascript-works/feed/" rel="self" type="application/rss+xml" />
	<link>http://misko.hevery.com/2010/07/14/how-javascript-works/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-javascript-works</link>
	<description>Testability Explorer</description>
	<lastBuildDate>Thu, 19 Jan 2012 16:42:57 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Matej</title>
		<link>http://misko.hevery.com/2010/07/14/how-javascript-works/comment-page-1/#comment-12383</link>
		<dc:creator>Matej</dc:creator>
		<pubDate>Fri, 18 Nov 2011 06:37:55 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=625#comment-12383</guid>
		<description>Hello,

please discard my previous post - I found out what is wrong. It is not JavaScript, it is iPad which has samoe limitations.

regards Matej</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>please discard my previous post &#8211; I found out what is wrong. It is not JavaScript, it is iPad which has samoe limitations.</p>
<p>regards Matej</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matej</title>
		<link>http://misko.hevery.com/2010/07/14/how-javascript-works/comment-page-1/#comment-9459</link>
		<dc:creator>Matej</dc:creator>
		<pubDate>Fri, 22 Jul 2011 10:51:51 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=625#comment-9459</guid>
		<description>Hello Misko, 

great presentation! 
I have a question about Ajax calls. What actually happens with JS exection when Ajax call is invoked?

I&#039;m asking this because I have next problem. When I call function playItem() it normally executes - creates HTML5 video tag and starts to play (function playLiveFlowplayer() createys HTML5 video tag on iPad, on PC it creates Flash player).


function playItem()
{
	var playerArea = $(&#039;#playerArea&#039;);
	var fpId = getFlowplayerId();
	playerArea.empty(); 
	
	playerArea.append(createQualityChooserHTML()+&#039;&#039;); 
	clipProperties.url = &#039;http://192.168.100.107:1935/ia/live/playlist.m3u8&#039;;
	playLiveFlowplayer(fpId, getWowzaUrl(&#039;ia&#039;), &#039;&#039;, &#039;&#039;, true, true);
}

But you can see that url is hardcoded - it has to be assigned by ajax call. So here is what I did: 
function playItem()
{
	$.ajax({
	url : &#039;playVODServlet&#039;,
	type : &#039;GET&#039;,
	data : JSON.stringify(playItemParams),
	timeout : 5000,
	dataType : &quot;json&quot;,
	error : function(xhr, ajaxOptions, thrownError)
	{
		console.error(&quot;Error&quot;);
	},
	success : function(searchResult)
	{
		var playerArea = $(&#039;#playerArea&#039;);
		var fpId = getFlowplayerId();
		playerArea.empty();
		
		playerArea.append(createQualityChooserHTML()+&#039;&#039;);
		clipProperties.url = searchResult.assetId;
		playLiveFlowplayer(fpId, getWowzaUrl(&#039;ia&#039;), &#039;&#039;, &#039;&#039;, true, true); 
	
	}
});

But now autostart doesn&#039;t work. Do you maybe know why?

Is there any good presentation about Ajax calls? And one more question: if I set interval to 1000 ms if I measure with Date() I get that interval has 998 (or similar) ms of time delay and not 1000 (or more). Can you explain why?

best Matej</description>
		<content:encoded><![CDATA[<p>Hello Misko, </p>
<p>great presentation!<br />
I have a question about Ajax calls. What actually happens with JS exection when Ajax call is invoked?</p>
<p>I&#8217;m asking this because I have next problem. When I call function playItem() it normally executes &#8211; creates HTML5 video tag and starts to play (function playLiveFlowplayer() createys HTML5 video tag on iPad, on PC it creates Flash player).</p>
<p>function playItem()<br />
{<br />
	var playerArea = $(&#8216;#playerArea&#8217;);<br />
	var fpId = getFlowplayerId();<br />
	playerArea.empty(); </p>
<p>	playerArea.append(createQualityChooserHTML()+&#8221;);<br />
	clipProperties.url = &#8216;<a href="http://192.168.100.107:1935/ia/live/playlist.m3u8&#039;" rel="nofollow">http://192.168.100.107:1935/ia/live/playlist.m3u8&#039;</a>;<br />
	playLiveFlowplayer(fpId, getWowzaUrl(&#8216;ia&#8217;), &#8221;, &#8221;, true, true);<br />
}</p>
<p>But you can see that url is hardcoded &#8211; it has to be assigned by ajax call. So here is what I did:<br />
function playItem()<br />
{<br />
	$.ajax({<br />
	url : &#8216;playVODServlet&#8217;,<br />
	type : &#8216;GET&#8217;,<br />
	data : JSON.stringify(playItemParams),<br />
	timeout : 5000,<br />
	dataType : &#8220;json&#8221;,<br />
	error : function(xhr, ajaxOptions, thrownError)<br />
	{<br />
		console.error(&#8220;Error&#8221;);<br />
	},<br />
	success : function(searchResult)<br />
	{<br />
		var playerArea = $(&#8216;#playerArea&#8217;);<br />
		var fpId = getFlowplayerId();<br />
		playerArea.empty();</p>
<p>		playerArea.append(createQualityChooserHTML()+&#8221;);<br />
		clipProperties.url = searchResult.assetId;<br />
		playLiveFlowplayer(fpId, getWowzaUrl(&#8216;ia&#8217;), &#8221;, &#8221;, true, true); </p>
<p>	}<br />
});</p>
<p>But now autostart doesn&#8217;t work. Do you maybe know why?</p>
<p>Is there any good presentation about Ajax calls? And one more question: if I set interval to 1000 ms if I measure with Date() I get that interval has 998 (or similar) ms of time delay and not 1000 (or more). Can you explain why?</p>
<p>best Matej</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: misko</title>
		<link>http://misko.hevery.com/2010/07/14/how-javascript-works/comment-page-1/#comment-8271</link>
		<dc:creator>misko</dc:creator>
		<pubDate>Wed, 18 May 2011 19:43:37 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=625#comment-8271</guid>
		<description>@Aj

since hero.constructor == Hero then
hero.constructor ===  hero.constructor.prototype.constructor becomes Hero === Hero.prototype.constructor which is true

A function automatically has a prototype property. 

So the real question is why is this true

hero.constructor === Hero.prototype.constructor

that is because
hero.__proto__ === Hero.prototype

Hero.prototype.hasProperty(&#039;constructor&#039;) == true
Hero.prototype.constructor == Hero
hero.constructor == Hero // inherited not actually on hero
hero.hasProperty(&#039;constructor&#039;) == false;

So the constructor property is inherited from the hero.__proto__ which is the same as the Hero.prototype</description>
		<content:encoded><![CDATA[<p>@Aj</p>
<p>since hero.constructor == Hero then<br />
hero.constructor ===  hero.constructor.prototype.constructor becomes Hero === Hero.prototype.constructor which is true</p>
<p>A function automatically has a prototype property. </p>
<p>So the real question is why is this true</p>
<p>hero.constructor === Hero.prototype.constructor</p>
<p>that is because<br />
hero.__proto__ === Hero.prototype</p>
<p>Hero.prototype.hasProperty(&#8216;constructor&#8217;) == true<br />
Hero.prototype.constructor == Hero<br />
hero.constructor == Hero // inherited not actually on hero<br />
hero.hasProperty(&#8216;constructor&#8217;) == false;</p>
<p>So the constructor property is inherited from the hero.__proto__ which is the same as the Hero.prototype</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aj</title>
		<link>http://misko.hevery.com/2010/07/14/how-javascript-works/comment-page-1/#comment-8267</link>
		<dc:creator>Aj</dc:creator>
		<pubDate>Wed, 18 May 2011 18:13:57 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=625#comment-8267</guid>
		<description>function Hero() { }

var hero = new Hero();
console.log(hero.constructor); //Hero()
console.log(hero.constructor.prototype); // Object{}
---------------------------------------------------
hero.constructor ===  hero.constructor.prototype.constructor; //true

Misko can you explain how the last line evaluated to true?</description>
		<content:encoded><![CDATA[<p>function Hero() { }</p>
<p>var hero = new Hero();<br />
console.log(hero.constructor); //Hero()<br />
console.log(hero.constructor.prototype); // Object{}<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
hero.constructor ===  hero.constructor.prototype.constructor; //true</p>
<p>Misko can you explain how the last line evaluated to true?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: misko</title>
		<link>http://misko.hevery.com/2010/07/14/how-javascript-works/comment-page-1/#comment-3816</link>
		<dc:creator>misko</dc:creator>
		<pubDate>Sun, 01 Aug 2010 14:49:20 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=625#comment-3816</guid>
		<description>@Krisna,

thanks for your kind words. believe it or not I have never read any JavaScript book.</description>
		<content:encoded><![CDATA[<p>@Krisna,</p>
<p>thanks for your kind words. believe it or not I have never read any JavaScript book.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Krishna</title>
		<link>http://misko.hevery.com/2010/07/14/how-javascript-works/comment-page-1/#comment-3813</link>
		<dc:creator>Krishna</dc:creator>
		<pubDate>Sun, 01 Aug 2010 08:09:30 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=625#comment-3813</guid>
		<description>Just mind-blowing presentation. You ran through  the idiosyncrasies in the language. Writing the language in the functional way feels more natural, you have dealt OO developer perspective of approaching the language which is very appropriate as they are lot of OO folks jumping in to the language with OO approach in mind. Explanation on differences between js and browser heaps were thought provoking.

Reference section citing some of the recent developments makes the presentation more complete.
Curious to know if you have read the book pro javascript design patterns by justina diaz and ross harmes.</description>
		<content:encoded><![CDATA[<p>Just mind-blowing presentation. You ran through  the idiosyncrasies in the language. Writing the language in the functional way feels more natural, you have dealt OO developer perspective of approaching the language which is very appropriate as they are lot of OO folks jumping in to the language with OO approach in mind. Explanation on differences between js and browser heaps were thought provoking.</p>
<p>Reference section citing some of the recent developments makes the presentation more complete.<br />
Curious to know if you have read the book pro javascript design patterns by justina diaz and ross harmes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Indrit Selimi</title>
		<link>http://misko.hevery.com/2010/07/14/how-javascript-works/comment-page-1/#comment-3802</link>
		<dc:creator>Indrit Selimi</dc:creator>
		<pubDate>Fri, 30 Jul 2010 08:05:26 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=625#comment-3802</guid>
		<description>Hi Misko,

I want to thank you for all these beautiful presentations! Keep going.

Indrit</description>
		<content:encoded><![CDATA[<p>Hi Misko,</p>
<p>I want to thank you for all these beautiful presentations! Keep going.</p>
<p>Indrit</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gropapa</title>
		<link>http://misko.hevery.com/2010/07/14/how-javascript-works/comment-page-1/#comment-3783</link>
		<dc:creator>gropapa</dc:creator>
		<pubDate>Thu, 22 Jul 2010 12:46:01 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=625#comment-3783</guid>
		<description>Nice video as usal!
May i point out that actionscript works almost the same about closures, apply() and call()
__proto__ &amp; prototype existed with as2 but are not available anymore (thank god btw)</description>
		<content:encoded><![CDATA[<p>Nice video as usal!<br />
May i point out that actionscript works almost the same about closures, apply() and call()<br />
__proto__ &amp; prototype existed with as2 but are not available anymore (thank god btw)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: misko</title>
		<link>http://misko.hevery.com/2010/07/14/how-javascript-works/comment-page-1/#comment-3766</link>
		<dc:creator>misko</dc:creator>
		<pubDate>Mon, 19 Jul 2010 02:41:43 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=625#comment-3766</guid>
		<description>@paul

I use jstestdriver for all of my development.
http://code.google.com/p/js-test-driver/</description>
		<content:encoded><![CDATA[<p>@paul</p>
<p>I use jstestdriver for all of my development.<br />
<a href="http://code.google.com/p/js-test-driver/" rel="nofollow">http://code.google.com/p/js-test-driver/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: paul</title>
		<link>http://misko.hevery.com/2010/07/14/how-javascript-works/comment-page-1/#comment-3765</link>
		<dc:creator>paul</dc:creator>
		<pubDate>Mon, 19 Jul 2010 02:06:57 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=625#comment-3765</guid>
		<description>very nice, enjoyed this a lot and it&#039;s really refreshing to see a talk that gets down to interesting differences and pieces of the language, instead of just covering syntax.

I know you are a big eclipse fan for java dev, are you using mostly browser windows for js dev or another setup?</description>
		<content:encoded><![CDATA[<p>very nice, enjoyed this a lot and it&#8217;s really refreshing to see a talk that gets down to interesting differences and pieces of the language, instead of just covering syntax.</p>
<p>I know you are a big eclipse fan for java dev, are you using mostly browser windows for js dev or another setup?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

