<?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: OpenSearch-enabling your blog</title>
	<atom:link href="http://www.phpied.com/opensearch-enabling-your-blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phpied.com/opensearch-enabling-your-blog/</link>
	<description>Stoyan&#039;s blog about &#60;a href=&#34;/category/xhtml&#34; class=&#34;tag-minor&#34;&#62;(x)html(5)&#60;/a&#62;, &#60;a href=&#34;/category/ajax&#34; class=&#34;tag-major&#34;&#62;ajax&#60;/a&#62;, &#60;a href=&#34;/category/bookmarklets&#34; class=&#34;tag-major&#34;&#62;bookmarklets&#60;/a&#62;, &#60;a href=&#34;/category/browsers&#34; class=&#34;tag-minor&#34;&#62;browsers&#60;/a&#62;, &#60;a href=&#34;/category/css&#34; class=&#34;tag-normal&#34;&#62;css&#60;/a&#62;, &#60;a href=&#34;/category/firebug&#34; class=&#34;tag-minor&#34;&#62;firebug&#60;/a&#62;, &#60;a href=&#34;/category/javascript&#34; class=&#34;tag-numero-uno&#34;&#62;javascript&#60;/a&#62;, &#60;a href=&#34;/category/json&#34; class=&#34;tag-normal&#34;&#62;json&#60;/a&#62;, &#60;a href=&#34;/category/mdb2&#34; class=&#34;tag-minor&#34;&#62;mdb2&#60;/a&#62;, &#60;a href=&#34;/category/mysql&#34; class=&#34;tag-normal&#34;&#62;mysql&#60;/a&#62;, &#60;a href=&#34;/category/pear&#34; class=&#34;tag-numero-uno&#34;&#62;pear&#60;/a&#62;, &#60;a href=&#34;/category/performance&#34; class=&#34;tag-major&#34;&#62;performance&#60;/a&#62;, &#60;a href=&#34;/category/php&#34; class=&#34;tag-numero-uno&#34;&#62;php&#60;/a&#62;, &#60;a href=&#34;/category/phpbb&#34; class=&#34;tag-major&#34;&#62;phpbb&#60;/a&#62;, &#60;a href=&#34;/category/tools&#34; class=&#34;tag-normal&#34;&#62;tools&#60;/a&#62;, &#60;a href=&#34;/category/yslow&#34; class=&#34;tag-minor&#34;&#62;yslow&#60;/a&#62;, &#60;a href=&#34;/category/yui&#34; class=&#34;tag-normal&#34;&#62;yui&#60;/a&#62;, &#60;a href=&#34;/category/writing&#34; class=&#34;tag-minor&#34;&#62;writing&#60;/a&#62;, &#60;a href=&#34;/category/music&#34; class=&#34;tag-major&#34;&#62;music&#60;/a&#62;,... &#60;a href=&#34;/category/life-and-everything&#34; class=&#34;tag-normal&#34;&#62;life and everything&#60;/a&#62;.</description>
	<lastBuildDate>Sat, 11 Feb 2012 14:07:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
	<item>
		<title>By: hunthide</title>
		<link>http://www.phpied.com/opensearch-enabling-your-blog/#comment-75242</link>
		<dc:creator>hunthide</dc:creator>
		<pubDate>Tue, 14 Dec 2010 20:01:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpied.com/?p=559#comment-75242</guid>
		<description>&quot;This functionality is following the open search standard.&quot;
What I can not believe!</description>
		<content:encoded><![CDATA[<p>&#8220;This functionality is following the open search standard.&#8221;<br />
What I can not believe!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Twitter Trackbacks for OpenSearch-enabling your blog / phpied.com [phpied.com] on Topsy.com</title>
		<link>http://www.phpied.com/opensearch-enabling-your-blog/#comment-71378</link>
		<dc:creator>Twitter Trackbacks for OpenSearch-enabling your blog / phpied.com [phpied.com] on Topsy.com</dc:creator>
		<pubDate>Mon, 31 Aug 2009 01:07:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpied.com/?p=559#comment-71378</guid>
		<description>[...] OpenSearch-enabling your blog / phpied.com  www.phpied.com/opensearch-enabling-your-blog &#8211; view page &#8211; cached  Stoyan&#039;s blog about (x)html, ajax, bookmarklets, browsers, css, firebug, javascript, json, mdb2, mysql, pear, performance, php, phpbb, tools, yslow, yui, writing, music,... life and everything. &#8212; From the page [...]</description>
		<content:encoded><![CDATA[<p>[...] OpenSearch-enabling your blog / phpied.com  <a href="http://www.phpied.com/opensearch-enabling-your-blog" rel="nofollow">http://www.phpied.com/opensearch-enabling-your-blog</a> &ndash; view page &ndash; cached  Stoyan&#8217;s blog about (x)html, ajax, bookmarklets, browsers, css, firebug, javascript, json, mdb2, mysql, pear, performance, php, phpbb, tools, yslow, yui, writing, music,&#8230; life and everything. &mdash; From the page [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: links for 2009-05-17 &#124; NeXt</title>
		<link>http://www.phpied.com/opensearch-enabling-your-blog/#comment-70857</link>
		<dc:creator>links for 2009-05-17 &#124; NeXt</dc:creator>
		<pubDate>Sun, 17 May 2009 14:34:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpied.com/?p=559#comment-70857</guid>
		<description>[...] OpenSearch-enabling your blog / phpied.com (tags: tutorial php blog plugin webdev opensearch firefox) [...]</description>
		<content:encoded><![CDATA[<p>[...] OpenSearch-enabling your blog / phpied.com (tags: tutorial php blog plugin webdev opensearch firefox) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stoyan</title>
		<link>http://www.phpied.com/opensearch-enabling-your-blog/#comment-70242</link>
		<dc:creator>Stoyan</dc:creator>
		<pubDate>Mon, 16 Feb 2009 08:08:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpied.com/?p=559#comment-70242</guid>
		<description>hey Zel,

Thanks for the question

MYAPP is a global variable, when you modify 
&lt;code&gt;MYAPP.myevent.addListener&lt;/code&gt;
even from inside a function, you&#039;re still modifying the property of a global  object.

same if you go something like:
&lt;code&gt;GLOBAL = 1;
function a() {
  GLOBAL = 2;
}
a();
alert(GLOBAL); // 2&lt;/code&gt;

In the example you quote, the branching happens only once and during that first call the function overwrites itself. So the second time you use it, it has a new body which doesn&#039;t have branching code in it.

You can easily test though. Just add a &lt;code&gt;console.log&lt;/code&gt; call, like:

&lt;pre&gt;...
MYAPP.myevent = {
  addListener: function(el, type, fn){
    console.log(&#039;called&#039;);
    if (typeof el.addEventListener === &#039;function&#039;) {
      //....
&lt;/pre&gt;
then use the function like 
&lt;code&gt;MYAPP.myevent.addListener(window, &#039;click&#039;, function(){alert(&#039;click&#039;)});&lt;/code&gt;
(this will pring &quot;called&quot; in the console)
and then again one more time
&lt;code&gt;MYAPP.myevent.addListener(window, &#039;click&#039;, function(){alert(&#039;click 2&#039;)});&lt;/code&gt;
(this will not print in the console)

Hope that helps!

S</description>
		<content:encoded><![CDATA[<p>hey Zel,</p>
<p>Thanks for the question</p>
<p>MYAPP is a global variable, when you modify<br />
<code>MYAPP.myevent.addListener</code><br />
even from inside a function, you&#8217;re still modifying the property of a global  object.</p>
<p>same if you go something like:<br />
<code>GLOBAL = 1;<br />
function a() {<br />
  GLOBAL = 2;<br />
}<br />
a();<br />
alert(GLOBAL); // 2</code></p>
<p>In the example you quote, the branching happens only once and during that first call the function overwrites itself. So the second time you use it, it has a new body which doesn&#8217;t have branching code in it.</p>
<p>You can easily test though. Just add a <code>console.log</code> call, like:</p>
<pre>...
MYAPP.myevent = {
  addListener: function(el, type, fn){
    console.log('called');
    if (typeof el.addEventListener === 'function') {
      //....
</pre>
<p>then use the function like<br />
<code>MYAPP.myevent.addListener(window, 'click', function(){alert('click')});</code><br />
(this will pring &#8220;called&#8221; in the console)<br />
and then again one more time<br />
<code>MYAPP.myevent.addListener(window, 'click', function(){alert('click 2')});</code><br />
(this will not print in the console)</p>
<p>Hope that helps!</p>
<p>S</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zel</title>
		<link>http://www.phpied.com/opensearch-enabling-your-blog/#comment-70241</link>
		<dc:creator>zel</dc:creator>
		<pubDate>Mon, 16 Feb 2009 07:42:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpied.com/?p=559#comment-70241</guid>
		<description>thanks , another question . 
I doubt the example from your explanation of &quot;Lazy defination&quot;.

At page 273 ,chapter 8 .

Your code like this :

*****************************
var MYAPP = {};
MYAPP.myevent = {
addListener: function(el, type, fn){
if (typeof el.addEventListener === &#039;function&#039;) {
MYAPP.myevent.addListener = function(el, type, fn) {
el.addEventListener(type, fn, false);
};
} else if (typeof el.attachEvent === &#039;function&#039;){
MYAPP.myevent.addListener = function(el, type, fn) {
el.attachEvent(&#039;on&#039; + type, fn);
};
} else {
MYAPP.myevent.addListener = function(el, type, fn) {
el[&#039;on&#039; + type] = fn;
};
}
MYAPP.myevent.addListener(el, type, fn);
}
};


************************************
This code should be runnable , but does addListener() only be defined  once like this ?

There is no return statement in your code , how can the subsequent calls of addListener() avoid running the branching?

Notify through email please . Thanks</description>
		<content:encoded><![CDATA[<p>thanks , another question .<br />
I doubt the example from your explanation of &#8220;Lazy defination&#8221;.</p>
<p>At page 273 ,chapter 8 .</p>
<p>Your code like this :</p>
<p>*****************************<br />
var MYAPP = {};<br />
MYAPP.myevent = {<br />
addListener: function(el, type, fn){<br />
if (typeof el.addEventListener === &#8216;function&#8217;) {<br />
MYAPP.myevent.addListener = function(el, type, fn) {<br />
el.addEventListener(type, fn, false);<br />
};<br />
} else if (typeof el.attachEvent === &#8216;function&#8217;){<br />
MYAPP.myevent.addListener = function(el, type, fn) {<br />
el.attachEvent(&#8216;on&#8217; + type, fn);<br />
};<br />
} else {<br />
MYAPP.myevent.addListener = function(el, type, fn) {<br />
el['on' + type] = fn;<br />
};<br />
}<br />
MYAPP.myevent.addListener(el, type, fn);<br />
}<br />
};</p>
<p>************************************<br />
This code should be runnable , but does addListener() only be defined  once like this ?</p>
<p>There is no return statement in your code , how can the subsequent calls of addListener() avoid running the branching?</p>
<p>Notify through email please . Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stoyan</title>
		<link>http://www.phpied.com/opensearch-enabling-your-blog/#comment-70213</link>
		<dc:creator>Stoyan</dc:creator>
		<pubDate>Tue, 10 Feb 2009 18:32:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpied.com/?p=559#comment-70213</guid>
		<description>Yes, Zel, you&#039;re absolutely right. &lt;code&gt;instanceof&lt;/code&gt; follows the inheritance chain so 

&lt;code&gt;h instanceof Object&lt;/code&gt; is indeed &lt;code&gt;true&lt;/code&gt;

Also

&lt;code&gt;&gt;&gt;&gt; Object.prototype.isPrototypeOf(Hero)
true&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Yes, Zel, you&#8217;re absolutely right. <code>instanceof</code> follows the inheritance chain so </p>
<p><code>h instanceof Object</code> is indeed <code>true</code></p>
<p>Also</p>
<p><code>&gt;&gt;&gt; Object.prototype.isPrototypeOf(Hero)<br />
true</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zel</title>
		<link>http://www.phpied.com/opensearch-enabling-your-blog/#comment-70210</link>
		<dc:creator>zel</dc:creator>
		<pubDate>Tue, 10 Feb 2009 07:37:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpied.com/?p=559#comment-70210</guid>
		<description>I am sorry if I post this comment  at the wrong place , but I can&#039;t found any other ways to contact  YOU.

When I was reading the book &quot;Object-Oriented Javascript&quot;, at page 103 ,Chapter 4 , I doubt the correctness of your examples.

You said :

&gt;&gt;&gt; function Hero(){}
&gt;&gt;&gt; var h = new Hero();
&gt;&gt;&gt; var o = {};
&gt;&gt;&gt; h instanceof Hero;
true
&gt;&gt;&gt; h instanceof Object;
false
&gt;&gt;&gt; o instanceof Object;
true

How can &quot;h instanceof Object&quot; be false ? I guess you want to say o instanceof Hero be false , am I right ?

Notify me through email ,please .</description>
		<content:encoded><![CDATA[<p>I am sorry if I post this comment  at the wrong place , but I can&#8217;t found any other ways to contact  YOU.</p>
<p>When I was reading the book &#8220;Object-Oriented Javascript&#8221;, at page 103 ,Chapter 4 , I doubt the correctness of your examples.</p>
<p>You said :</p>
<p>&gt;&gt;&gt; function Hero(){}<br />
&gt;&gt;&gt; var h = new Hero();<br />
&gt;&gt;&gt; var o = {};<br />
&gt;&gt;&gt; h instanceof Hero;<br />
true<br />
&gt;&gt;&gt; h instanceof Object;<br />
false<br />
&gt;&gt;&gt; o instanceof Object;<br />
true</p>
<p>How can &#8220;h instanceof Object&#8221; be false ? I guess you want to say o instanceof Hero be false , am I right ?</p>
<p>Notify me through email ,please .</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lolol</title>
		<link>http://www.phpied.com/opensearch-enabling-your-blog/#comment-70204</link>
		<dc:creator>lolol</dc:creator>
		<pubDate>Fri, 06 Feb 2009 17:19:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpied.com/?p=559#comment-70204</guid>
		<description>ah how foolish of me to not actually look through the code
maybe I am breaking some sort of standards by not using os: tags like you
Also will wordpress always make such a ridiculously long description line?
optimization seems to usually matter more for things that get encoded to base64, as in your image&#039;s case 342bytes for image = 484bytes of base64, while optimized only a 66 byte diff of 276bytes for the optimized image is a difference of 116 bytes for the encoded file compared to the original

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAA20lEQVR4XmXN3ypFQRSA8cVzUN5hnZ7KioP4EYipdIJnahDhAokuSU6J5v9d8xsn9VUk5m9vsv1mzWisySZ5Ekrsihhsq6wvSNEx9rqf5LbvqL2ffHJO4431gNZkNzRYmi1koIPHA0VG0oCMEwYs88uW2yGryTXrQdYnGbpDczPniNgeOME445YJ89dthmngItXGko+U7BNRdMOWXCEYeMaWIQ3zBal4IHbrnhikvOtekA+Kz2E0rAC8888cg9dz4bgV8lw3oFfkamdv1wbUrJxM+yjNQOy3QjfgORR5brtfZAAAAAElFTkSuQmCC</description>
		<content:encoded><![CDATA[<p>ah how foolish of me to not actually look through the code<br />
maybe I am breaking some sort of standards by not using os: tags like you<br />
Also will wordpress always make such a ridiculously long description line?<br />
optimization seems to usually matter more for things that get encoded to base64, as in your image&#8217;s case 342bytes for image = 484bytes of base64, while optimized only a 66 byte diff of 276bytes for the optimized image is a difference of 116 bytes for the encoded file compared to the original</p>
<p>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAA20lEQVR4XmXN3ypFQRSA8cVzUN5hnZ7KioP4EYipdIJnahDhAokuSU6J5v9d8xsn9VUk5m9vsv1mzWisySZ5Ekrsihhsq6wvSNEx9rqf5LbvqL2ffHJO4431gNZkNzRYmi1koIPHA0VG0oCMEwYs88uW2yGryTXrQdYnGbpDczPniNgeOME445YJ89dthmngItXGko+U7BNRdMOWXCEYeMaWIQ3zBal4IHbrnhikvOtekA+Kz2E0rAC8888cg9dz4bgV8lw3oFfkamdv1wbUrJxM+yjNQOy3QjfgORR5brtfZAAAAAElFTkSuQmCC</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stoyan</title>
		<link>http://www.phpied.com/opensearch-enabling-your-blog/#comment-70202</link>
		<dc:creator>Stoyan</dc:creator>
		<pubDate>Thu, 05 Feb 2009 17:11:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpied.com/?p=559#comment-70202</guid>
		<description>Thanks lolol, that&#039;s what this plugin seems to do.

Good point about optimizing the png :)</description>
		<content:encoded><![CDATA[<p>Thanks lolol, that&#8217;s what this plugin seems to do.</p>
<p>Good point about optimizing the png <img src='http://www.phpied.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lolol</title>
		<link>http://www.phpied.com/opensearch-enabling-your-blog/#comment-70201</link>
		<dc:creator>lolol</dc:creator>
		<pubDate>Thu, 05 Feb 2009 15:19:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpied.com/?p=559#comment-70201</guid>
		<description>hey stoyan
another way to do the image is to include it in the xml itself as a base64 encoded png
I at least prefer that way in sites I&#039;ve worked on after I&#039;ve optimized the png</description>
		<content:encoded><![CDATA[<p>hey stoyan<br />
another way to do the image is to include it in the xml itself as a base64 encoded png<br />
I at least prefer that way in sites I&#8217;ve worked on after I&#8217;ve optimized the png</p>
]]></content:encoded>
	</item>
</channel>
</rss>

