<?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: Autcompletion Issues with Yahoo, Scriptaculous Libraries</title>
	<atom:link href="http://ajaxian.com/archives/autcompletion-issues-with-yahoo-and-scriptaculous-libraries/feed" rel="self" type="application/rss+xml" />
	<link>http://ajaxian.com/archives/autcompletion-issues-with-yahoo-and-scriptaculous-libraries</link>
	<description>Cleaning up the web with Ajax</description>
	<lastBuildDate>Thu, 17 May 2012 07:43:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Matt Reed</title>
		<link>http://ajaxian.com/archives/autcompletion-issues-with-yahoo-and-scriptaculous-libraries/comment-page-1#comment-218412</link>
		<dc:creator>Matt Reed</dc:creator>
		<pubDate>Wed, 29 Nov 2006 21:18:16 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=1301#comment-218412</guid>
		<description>In prototype 1.5.0_rc1 and scriptaculous 1.6.4 we had this problem and in 9.5 minutes we had a solution.

To the definition of Ajax.Request in prototype.js we added the function:
&lt;code&gt;
    abort: function() {
        this.transport.abort();
    }
&lt;/code&gt;

In Scriptaculous (controls.js) Ajax.Autocompleter:
we declared a global variable:
&lt;code&gt;
var my_search;
&lt;/code&gt;

we updated getUpdatedChoices() so the last two lines in the method look like:
&lt;code&gt;
       //line added
        try {my_search.abort();} catch (e) {}
        //line changed
        my_search = new Ajax.Request(this.url, this.options);
&lt;/code&gt;
&lt;i&gt;Thanks to zac for leading us down the right path. &lt;/i&gt;</description>
		<content:encoded><![CDATA[<p>In prototype 1.5.0_rc1 and scriptaculous 1.6.4 we had this problem and in 9.5 minutes we had a solution.</p>
<p>To the definition of Ajax.Request in prototype.js we added the function:<br />
<code><br />
    abort: function() {<br />
        this.transport.abort();<br />
    }<br />
</code></p>
<p>In Scriptaculous (controls.js) Ajax.Autocompleter:<br />
we declared a global variable:<br />
<code><br />
var my_search;<br />
</code></p>
<p>we updated getUpdatedChoices() so the last two lines in the method look like:<br />
<code><br />
       //line added<br />
        try {my_search.abort();} catch (e) {}<br />
        //line changed<br />
        my_search = new Ajax.Request(this.url, this.options);<br />
</code><br />
<i>Thanks to zac for leading us down the right path. </i></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vital</title>
		<link>http://ajaxian.com/archives/autcompletion-issues-with-yahoo-and-scriptaculous-libraries/comment-page-1#comment-67557</link>
		<dc:creator>Vital</dc:creator>
		<pubDate>Tue, 15 Aug 2006 09:09:17 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=1301#comment-67557</guid>
		<description>For script.aculo.us just use Form.Element.DelayedObserver in Autocompleter (controls.js):

&lt;b&gt;Wrong way (as you can see in controls.js):&lt;/b&gt;
    Event.observe(this.element, &quot;blur&quot;, this.onBlur.bindAsEventListener(this));
    Event.observe(this.element, &quot;keypress&quot;, this.onKeyPress.bindAsEventListener(this));

&lt;b&gt;Right way:&lt;/b&gt;
    Event.observe(this.element, &quot;blur&quot;, this.onBlur.bindAsEventListener(this));
    new Form.Element.DelayedObserver(this.element, 0.5, this.onKeyPress.bindAsEventListener(this));</description>
		<content:encoded><![CDATA[<p>For script.aculo.us just use Form.Element.DelayedObserver in Autocompleter (controls.js):</p>
<p><b>Wrong way (as you can see in controls.js):</b><br />
    Event.observe(this.element, &#8220;blur&#8221;, this.onBlur.bindAsEventListener(this));<br />
    Event.observe(this.element, &#8220;keypress&#8221;, this.onKeyPress.bindAsEventListener(this));</p>
<p><b>Right way:</b><br />
    Event.observe(this.element, &#8220;blur&#8221;, this.onBlur.bindAsEventListener(this));<br />
    new Form.Element.DelayedObserver(this.element, 0.5, this.onKeyPress.bindAsEventListener(this));</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wei</title>
		<link>http://ajaxian.com/archives/autcompletion-issues-with-yahoo-and-scriptaculous-libraries/comment-page-1#comment-34477</link>
		<dc:creator>wei</dc:creator>
		<pubDate>Sat, 24 Jun 2006 07:17:34 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=1301#comment-34477</guid>
		<description>The simplest way is to only allow 1 request pending at anytime. If a higher priority request is required, pending requests can be aborted.</description>
		<content:encoded><![CDATA[<p>The simplest way is to only allow 1 request pending at anytime. If a higher priority request is required, pending requests can be aborted.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nilesh</title>
		<link>http://ajaxian.com/archives/autcompletion-issues-with-yahoo-and-scriptaculous-libraries/comment-page-1#comment-34363</link>
		<dc:creator>Nilesh</dc:creator>
		<pubDate>Sat, 24 Jun 2006 04:45:19 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=1301#comment-34363</guid>
		<description>Its not that hard to slove, my guess would be just to Abort the Ajax call, when trying to send a new Ajax call on key up.

1. User enters 2006 
2. (on key up) Ajax Call, find match for 2006 results query
3. user types 200698 or whaterver.
4. abort #2 query, ajax call 
5. Ajac call for #3
6. Loop if needed.


All the librarys do support some method of abort() for ajax requests,

right? or no?</description>
		<content:encoded><![CDATA[<p>Its not that hard to slove, my guess would be just to Abort the Ajax call, when trying to send a new Ajax call on key up.</p>
<p>1. User enters 2006<br />
2. (on key up) Ajax Call, find match for 2006 results query<br />
3. user types 200698 or whaterver.<br />
4. abort #2 query, ajax call<br />
5. Ajac call for #3<br />
6. Loop if needed.</p>
<p>All the librarys do support some method of abort() for ajax requests,</p>
<p>right? or no?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ted</title>
		<link>http://ajaxian.com/archives/autcompletion-issues-with-yahoo-and-scriptaculous-libraries/comment-page-1#comment-34359</link>
		<dc:creator>Ted</dc:creator>
		<pubDate>Sat, 24 Jun 2006 04:40:54 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=1301#comment-34359</guid>
		<description>Isn&#039;t this simply one of the issues with using async requests?  Your responses may come back in a different order than the requests were went.  Using a sequence sent with each request and returned by a response will help, but only if the UI state of the suggestion box is  orthogonal to any other page state.</description>
		<content:encoded><![CDATA[<p>Isn&#8217;t this simply one of the issues with using async requests?  Your responses may come back in a different order than the requests were went.  Using a sequence sent with each request and returned by a response will help, but only if the UI state of the suggestion box is  orthogonal to any other page state.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthew Ratzloff</title>
		<link>http://ajaxian.com/archives/autcompletion-issues-with-yahoo-and-scriptaculous-libraries/comment-page-1#comment-34188</link>
		<dc:creator>Matthew Ratzloff</dc:creator>
		<pubDate>Sat, 24 Jun 2006 00:21:59 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=1301#comment-34188</guid>
		<description>&lt;blockquote&gt;It should be noted that he is selling a solution for $50 to the â€˜problemâ€™ in these libraries.&lt;/blockquote&gt;

Ugh...</description>
		<content:encoded><![CDATA[<blockquote><p>It should be noted that he is selling a solution for $50 to the â€˜problemâ€™ in these libraries.</p></blockquote>
<p>Ugh&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ram</title>
		<link>http://ajaxian.com/archives/autcompletion-issues-with-yahoo-and-scriptaculous-libraries/comment-page-1#comment-33953</link>
		<dc:creator>Ram</dc:creator>
		<pubDate>Fri, 23 Jun 2006 20:27:15 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=1301#comment-33953</guid>
		<description>I&#039;ve been working this problem for a while. This is also a problem when you use Prototype to build and track your ajax request/responses. You will need to build some sort of call stack mechanism and return a parameter with your response that helps you match it up with the request.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve been working this problem for a while. This is also a problem when you use Prototype to build and track your ajax request/responses. You will need to build some sort of call stack mechanism and return a parameter with your response that helps you match it up with the request.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy</title>
		<link>http://ajaxian.com/archives/autcompletion-issues-with-yahoo-and-scriptaculous-libraries/comment-page-1#comment-33423</link>
		<dc:creator>Andy</dc:creator>
		<pubDate>Fri, 23 Jun 2006 02:23:01 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=1301#comment-33423</guid>
		<description>This problem does exist, and once you see it, it takes 10 minutes to fix, if that.  I don&#039;t know if it warrants this much attention though.</description>
		<content:encoded><![CDATA[<p>This problem does exist, and once you see it, it takes 10 minutes to fix, if that.  I don&#8217;t know if it warrants this much attention though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zac</title>
		<link>http://ajaxian.com/archives/autcompletion-issues-with-yahoo-and-scriptaculous-libraries/comment-page-1#comment-33302</link>
		<dc:creator>zac</dc:creator>
		<pubDate>Thu, 22 Jun 2006 22:48:14 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=1301#comment-33302</guid>
		<description>I found a workaround to this for Scriptaculous using the onLoading option.

&lt;code&gt;
// global var
var my_search;

// option for Ajax.Autocompleter
onLoading: function(request)
{									 		
	// kill the last search that might be pending		
	try { my_search.abort(); } catch (e) {}
										
	my_search = request;
}
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>I found a workaround to this for Scriptaculous using the onLoading option.</p>
<p><code><br />
// global var<br />
var my_search;</p>
<p>// option for Ajax.Autocompleter<br />
onLoading: function(request)<br />
{<br />
	// kill the last search that might be pending<br />
	try { my_search.abort(); } catch (e) {}</p>
<p>	my_search = request;<br />
}<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott</title>
		<link>http://ajaxian.com/archives/autcompletion-issues-with-yahoo-and-scriptaculous-libraries/comment-page-1#comment-33297</link>
		<dc:creator>Scott</dc:creator>
		<pubDate>Thu, 22 Jun 2006 22:41:52 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=1301#comment-33297</guid>
		<description>An easy fix for the Yahoo libraries is to modify _populateList.  If the query does not currently match whatever is in the text box, just ignore it.  It works quite well for me.

if (sQuery != oSelf._oTextbox.value) { return; }</description>
		<content:encoded><![CDATA[<p>An easy fix for the Yahoo libraries is to modify _populateList.  If the query does not currently match whatever is in the text box, just ignore it.  It works quite well for me.</p>
<p>if (sQuery != oSelf._oTextbox.value) { return; }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oliver</title>
		<link>http://ajaxian.com/archives/autcompletion-issues-with-yahoo-and-scriptaculous-libraries/comment-page-1#comment-33233</link>
		<dc:creator>Oliver</dc:creator>
		<pubDate>Thu, 22 Jun 2006 21:05:07 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=1301#comment-33233</guid>
		<description>Did someone test the suff from Michael? Where can I get this control? (Sorry, I&#039;m .NET developer).</description>
		<content:encoded><![CDATA[<p>Did someone test the suff from Michael? Where can I get this control? (Sorry, I&#8217;m .NET developer).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chenggn</title>
		<link>http://ajaxian.com/archives/autcompletion-issues-with-yahoo-and-scriptaculous-libraries/comment-page-1#comment-33122</link>
		<dc:creator>chenggn</dc:creator>
		<pubDate>Thu, 22 Jun 2006 17:53:17 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=1301#comment-33122</guid>
		<description>Nate, you can&#039;t say I&#039;m not correct because of I do spam.

Sorry for spam you. :P

I record the screencast on my AMD Althon 2000+ with 1G memory.  I made it *played slowly than the actuly speed* to make sure that everyone could see what happen clearly.</description>
		<content:encoded><![CDATA[<p>Nate, you can&#8217;t say I&#8217;m not correct because of I do spam.</p>
<p>Sorry for spam you. :P</p>
<p>I record the screencast on my AMD Althon 2000+ with 1G memory.  I made it *played slowly than the actuly speed* to make sure that everyone could see what happen clearly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nate</title>
		<link>http://ajaxian.com/archives/autcompletion-issues-with-yahoo-and-scriptaculous-libraries/comment-page-1#comment-33119</link>
		<dc:creator>nate</dc:creator>
		<pubDate>Thu, 22 Jun 2006 17:40:45 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=1301#comment-33119</guid>
		<description>@Thomas: I agree with you in spirit, but I&#039;m pretty sure this guy is just out to hawk his wares.  He&#039;s been spamming all Ajax and web-dev related mailing lists lately.  It actually looks like he ran yours on a slower machine to make his product look better.</description>
		<content:encoded><![CDATA[<p>@Thomas: I agree with you in spirit, but I&#8217;m pretty sure this guy is just out to hawk his wares.  He&#8217;s been spamming all Ajax and web-dev related mailing lists lately.  It actually looks like he ran yours on a slower machine to make his product look better.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alexei</title>
		<link>http://ajaxian.com/archives/autcompletion-issues-with-yahoo-and-scriptaculous-libraries/comment-page-1#comment-33115</link>
		<dc:creator>alexei</dc:creator>
		<pubDate>Thu, 22 Jun 2006 17:31:11 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=1301#comment-33115</guid>
		<description>I encourage you guys to check this one out too:
http://developer.ebusiness-apps.com/technologies/webdevelopment/codeandcomponents/ebawebcombov3/media/demos.htm</description>
		<content:encoded><![CDATA[<p>I encourage you guys to check this one out too:<br />
<a href="http://developer.ebusiness-apps.com/technologies/webdevelopment/codeandcomponents/ebawebcombov3/media/demos.htm" rel="nofollow">http://developer.ebusiness-apps.com/technologies/webdevelopment/codeandcomponents/ebawebcombov3/media/demos.htm</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Mahemoff</title>
		<link>http://ajaxian.com/archives/autcompletion-issues-with-yahoo-and-scriptaculous-libraries/comment-page-1#comment-33105</link>
		<dc:creator>Michael Mahemoff</dc:creator>
		<pubDate>Thu, 22 Jun 2006 17:03:55 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=1301#comment-33105</guid>
		<description>Eric, indeed that&#039;s what I was getting at with Call Tracking. Also, you don&#039;t actually have to transfer the number back and forth if you don&#039;t want (ie you can leave the server-side alone); just associate an incrementing call ID with the XHR itself. When the response comes back, the handling XHR looks at its own call ID and decides whether it&#039;s the newest XHR to be used so far.</description>
		<content:encoded><![CDATA[<p>Eric, indeed that&#8217;s what I was getting at with Call Tracking. Also, you don&#8217;t actually have to transfer the number back and forth if you don&#8217;t want (ie you can leave the server-side alone); just associate an incrementing call ID with the XHR itself. When the response comes back, the handling XHR looks at its own call ID and decides whether it&#8217;s the newest XHR to be used so far.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nir Tayeb</title>
		<link>http://ajaxian.com/archives/autcompletion-issues-with-yahoo-and-scriptaculous-libraries/comment-page-1#comment-33100</link>
		<dc:creator>Nir Tayeb</dc:creator>
		<pubDate>Thu, 22 Jun 2006 16:56:58 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=1301#comment-33100</guid>
		<description>Why call again to the server?

If the last query is the beginning of the new search query, so we can just filter the last search result and show the filtered list.
Else, call again to the server.</description>
		<content:encoded><![CDATA[<p>Why call again to the server?</p>
<p>If the last query is the beginning of the new search query, so we can just filter the last search result and show the filtered list.<br />
Else, call again to the server.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Leech</title>
		<link>http://ajaxian.com/archives/autcompletion-issues-with-yahoo-and-scriptaculous-libraries/comment-page-1#comment-33092</link>
		<dc:creator>Jonathan Leech</dc:creator>
		<pubDate>Thu, 22 Jun 2006 16:40:37 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=1301#comment-33092</guid>
		<description>How about calling abort() on the XMLHttpRequest object before sending the second request?</description>
		<content:encoded><![CDATA[<p>How about calling abort() on the XMLHttpRequest object before sending the second request?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aanand</title>
		<link>http://ajaxian.com/archives/autcompletion-issues-with-yahoo-and-scriptaculous-libraries/comment-page-1#comment-33086</link>
		<dc:creator>Aanand</dc:creator>
		<pubDate>Thu, 22 Jun 2006 16:33:10 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=1301#comment-33086</guid>
		<description>Is it ever useful to have a list of search results for a string that &lt;i&gt;isn&#039;t&lt;/i&gt; the value of the input field any more? I haven&#039;t ever used Autocomplete, so I don&#039;t know. But if it isn&#039;t, then surely the callback handling the Ajax request could just check to see if the text in the input field is the same as the string that was sent to the server?

In which case step 7 would become: the first request returns, but does nothing because the text in the input field is no longer &quot;2006&quot;.</description>
		<content:encoded><![CDATA[<p>Is it ever useful to have a list of search results for a string that <i>isn&#8217;t</i> the value of the input field any more? I haven&#8217;t ever used Autocomplete, so I don&#8217;t know. But if it isn&#8217;t, then surely the callback handling the Ajax request could just check to see if the text in the input field is the same as the string that was sent to the server?</p>
<p>In which case step 7 would become: the first request returns, but does nothing because the text in the input field is no longer &#8220;2006&#8243;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: G Jones</title>
		<link>http://ajaxian.com/archives/autcompletion-issues-with-yahoo-and-scriptaculous-libraries/comment-page-1#comment-33063</link>
		<dc:creator>G Jones</dc:creator>
		<pubDate>Thu, 22 Jun 2006 15:58:27 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=1301#comment-33063</guid>
		<description>Wasn&#039;t there a talk about this at this year&#039;s PHP conference in London? 
It&#039;s hardly a revelation...

And the preview thing on these comments (I assume...) means letters don&#039;t appear for a good 5 seconds after I&#039;ve typed them...rather annoying.</description>
		<content:encoded><![CDATA[<p>Wasn&#8217;t there a talk about this at this year&#8217;s PHP conference in London?<br />
It&#8217;s hardly a revelation&#8230;</p>
<p>And the preview thing on these comments (I assume&#8230;) means letters don&#8217;t appear for a good 5 seconds after I&#8217;ve typed them&#8230;rather annoying.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Schwarz</title>
		<link>http://ajaxian.com/archives/autcompletion-issues-with-yahoo-and-scriptaculous-libraries/comment-page-1#comment-33018</link>
		<dc:creator>Michael Schwarz</dc:creator>
		<pubDate>Thu, 22 Jun 2006 14:39:51 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=1301#comment-33018</guid>
		<description>Yes, this would be an idea. I&#039;m currently not allowing to start another request while one is running.</description>
		<content:encoded><![CDATA[<p>Yes, this would be an idea. I&#8217;m currently not allowing to start another request while one is running.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

