<?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: AJAX Suggestions &#8211; a new JavaScript library for you</title>
	<atom:link href="http://robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/feed/" rel="self" type="application/rss+xml" />
	<link>http://robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/</link>
	<description>Web development and Internet trends</description>
	<lastBuildDate>Sat, 20 Mar 2010 05:17:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Cris</title>
		<link>http://robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-612466</link>
		<dc:creator>Cris</dc:creator>
		<pubDate>Tue, 01 Dec 2009 07:59:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-612466</guid>
		<description>@Mori, Your code works great when you enter a second (third, fourth and so on) value in the input field, but is not working on the first one as the original code did... this is happening in Firefox and Safari for Mac :-(.</description>
		<content:encoded><![CDATA[<p>@Mori, Your code works great when you enter a second (third, fourth and so on) value in the input field, but is not working on the first one as the original code did&#8230; this is happening in Firefox and Safari for Mac <img src='http://robertnyman.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> .</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tuananh</title>
		<link>http://robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-608433</link>
		<dc:creator>tuananh</dc:creator>
		<pubDate>Mon, 02 Nov 2009 07:59:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-608433</guid>
		<description>I can&#039;t apply ajax suggestion in codeigniter. Can you show me. I think it concern to link url</description>
		<content:encoded><![CDATA[<p>I can&#8217;t apply ajax suggestion in codeigniter. Can you show me. I think it concern to link url</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin</title>
		<link>http://robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-596182</link>
		<dc:creator>Martin</dc:creator>
		<pubDate>Thu, 30 Jul 2009 23:23:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-596182</guid>
		<description>Couple of important notes... heh.

Someone mentioned unescape earlier... i noticed this happening in IE6 for Win. so if my result was &quot;Las Vegas&quot; in my suggest popup, when clicked, it would show as &quot;Las%20Vegas&quot; in the input.

after this line:
input.value = ((input.value.length &gt; 0 &amp;&amp; /;/i.test(input.value))? (input.value + value[value.length-1]) : value[value.length-1]) + ajaxSuggestions.itemSeparator;

i added this:
input.value = unescape(input.value);

so far working well.

Also, i used this script in conjunction with a dropdown box which changed what it should suggest. I used JS to change the class to a different URL for a different search / suggestions upon changing the dropdown. You have to re-initialize the suggestion script when you change the class on the fly.

ie. 
document.getElementById(&quot;my_search&quot;).className = &#039;ajax-suggestion url-my_suggest.php&#039;;
ajaxSuggestions.init();

Cheers.</description>
		<content:encoded><![CDATA[<p>Couple of important notes&#8230; heh.</p>
<p>Someone mentioned unescape earlier&#8230; i noticed this happening in IE6 for Win. so if my result was &#8220;Las Vegas&#8221; in my suggest popup, when clicked, it would show as &#8220;Las%20Vegas&#8221; in the input.</p>
<p>after this line:<br />
input.value = ((input.value.length &gt; 0 &amp;&amp; /;/i.test(input.value))? (input.value + value[value.length-1]) : value[value.length-1]) + ajaxSuggestions.itemSeparator;</p>
<p>i added this:<br />
input.value = unescape(input.value);</p>
<p>so far working well.</p>
<p>Also, i used this script in conjunction with a dropdown box which changed what it should suggest. I used JS to change the class to a different URL for a different search / suggestions upon changing the dropdown. You have to re-initialize the suggestion script when you change the class on the fly.</p>
<p>ie.<br />
document.getElementById(&#8220;my_search&#8221;).className = &#8216;ajax-suggestion url-my_suggest.php&#8217;;<br />
ajaxSuggestions.init();</p>
<p>Cheers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sumitavo biswas</title>
		<link>http://robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-595440</link>
		<dc:creator>Sumitavo biswas</dc:creator>
		<pubDate>Wed, 22 Jul 2009 23:52:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-595440</guid>
		<description>basically its how to replace this to accept the url in above format

var url = this.currentElm.className.replace(/.*url-([\w\/\?\.-]+).*/, &quot;$1&quot;);</description>
		<content:encoded><![CDATA[<p>basically its how to replace this to accept the url in above format</p>
<p>var url = this.currentElm.className.replace(/.*url-([\w\/\?\.-]+).*/, &#8220;$1&#8243;);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sumitavo biswas</title>
		<link>http://robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-595436</link>
		<dc:creator>Sumitavo biswas</dc:creator>
		<pubDate>Wed, 22 Jul 2009 23:38:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-595436</guid>
		<description>Hi all,

Its actually related to an old post, does the classname parameter supports url in form http://some url:port/ etc. if not can anybody tell the resolution</description>
		<content:encoded><![CDATA[<p>Hi all,</p>
<p>Its actually related to an old post, does the classname parameter supports url in form <a href="http://some" rel="nofollow">http://some</a> url:port/ etc. if not can anybody tell the resolution</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-581007</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Thu, 07 May 2009 18:32:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-581007</guid>
		<description>Martin,

Hmm, sounds weird with the ampersands. I don&#039;t know what that can be.

Adam,

No idea, actually. I briefly looked over the script, and I can&#039;t see why that would happen. Sorry.</description>
		<content:encoded><![CDATA[<p>Martin,</p>
<p>Hmm, sounds weird with the ampersands. I don&#8217;t know what that can be.</p>
<p>Adam,</p>
<p>No idea, actually. I briefly looked over the script, and I can&#8217;t see why that would happen. Sorry.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam</title>
		<link>http://robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-580991</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Thu, 07 May 2009 17:23:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-580991</guid>
		<description>hello,

I think it&#039;s a great script and very easy to configure.

I have one problem though - it&#039;s related to the position of the suggestion box against the input box. It&#039;s not always in the same position (vertically) but &quot;moves&quot; right, depending what size the browser window is set to. I.e. 800x600 - it&#039;s aligned as expected. 1024x1768 - slightly right, lets say 10 pixels margin compared to the input field. 1280x1024 - suggestion box starts in the middle if the input field.

Any idea why this is happening? Offset parameters are set 0.

Regards,
Adam</description>
		<content:encoded><![CDATA[<p>hello,</p>
<p>I think it&#8217;s a great script and very easy to configure.</p>
<p>I have one problem though &#8211; it&#8217;s related to the position of the suggestion box against the input box. It&#8217;s not always in the same position (vertically) but &#8220;moves&#8221; right, depending what size the browser window is set to. I.e. 800&#215;600 &#8211; it&#8217;s aligned as expected. 1024&#215;1768 &#8211; slightly right, lets say 10 pixels margin compared to the input field. 1280&#215;1024 &#8211; suggestion box starts in the middle if the input field.</p>
<p>Any idea why this is happening? Offset parameters are set 0.</p>
<p>Regards,<br />
Adam</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin</title>
		<link>http://robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-575220</link>
		<dc:creator>Martin</dc:creator>
		<pubDate>Tue, 21 Apr 2009 08:54:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-575220</guid>
		<description>Also, I am actually having a problem myself. Seems that you cannot type an ampersand in the search field in say Google Chrome / Safari, but you can in Firefox. Only happens once the suggest box has loaded. Can&#039;t seem to find any reference to it as a keycode, so i&#039;m not sure what is going on. Maybe a browser specific glitch?</description>
		<content:encoded><![CDATA[<p>Also, I am actually having a problem myself. Seems that you cannot type an ampersand in the search field in say Google Chrome / Safari, but you can in Firefox. Only happens once the suggest box has loaded. Can&#8217;t seem to find any reference to it as a keycode, so i&#8217;m not sure what is going on. Maybe a browser specific glitch?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin</title>
		<link>http://robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-575207</link>
		<dc:creator>Martin</dc:creator>
		<pubDate>Tue, 21 Apr 2009 08:25:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-575207</guid>
		<description>Trevor,

I had the same problem. i used onfocus as well as onkeyup which fixed the issue. this does however make an ajax call everytime you click the input field, but you can easily program it to check if the value has changed before it uses the onfocus call.</description>
		<content:encoded><![CDATA[<p>Trevor,</p>
<p>I had the same problem. i used onfocus as well as onkeyup which fixed the issue. this does however make an ajax call everytime you click the input field, but you can easily program it to check if the value has changed before it uses the onfocus call.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-570288</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Tue, 14 Apr 2009 20:14:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-570288</guid>
		<description>Trevor,

I understand the sentiment about Firefox... :-)
What if you were to try events like &lt;code&gt;onclick=&quot;doSomething()&quot;&lt;/code&gt; instead of the &lt;code&gt;href&lt;/code&gt; attribute?</description>
		<content:encoded><![CDATA[<p>Trevor,</p>
<p>I understand the sentiment about Firefox&#8230; <img src='http://robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
What if you were to try events like <code>onclick="doSomething()"</code> instead of the <code>href</code> attribute?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-565100</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Wed, 08 Apr 2009 21:16:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-565100</guid>
		<description>Correction:

Nothing works in FF.  In IE, I get the following behavior:

javascript: alert(&quot;Hello World&quot;); works just fine.
javascript: myFunc(someVar); works if I tab to the result and press enter, but does nothing if I mouse over and click the link.</description>
		<content:encoded><![CDATA[<p>Correction:</p>
<p>Nothing works in FF.  In IE, I get the following behavior:</p>
<p>javascript: alert(&#8220;Hello World&#8221;); works just fine.<br />
javascript: myFunc(someVar); works if I tab to the result and press enter, but does nothing if I mouse over and click the link.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-565071</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Wed, 08 Apr 2009 20:29:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-565071</guid>
		<description>So I&#039;m presenting a list of results like so:
&lt;code&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://example.com&quot;&gt;Example.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;javascript: myFunc(somevar);&quot;&gt;JS Link&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/code&gt;

In Firefox the regular &lt;a&gt;&#039;s work just fine, the javascript ones do nothing, even with a simple javascript: alert(&quot;Hello World&quot;); as the href attribute.   Is there a workaround for this?

In IE7 everything works as expected.  This has me flummoxed, as I&#039;m supposed to be able to blame my difficulties on IE; I feel guilty for being upset with FF.

Any ideas?</description>
		<content:encoded><![CDATA[<p>So I&#8217;m presenting a list of results like so:<br />
<code><br />
&lt;ul&gt;<br />
&lt;li&gt;&lt;a href="http://example.com"&gt;Example.com&lt;/a&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a href="javascript: myFunc(somevar);"&gt;JS Link&lt;/a&gt;&lt;/li&gt;<br />
&lt;/ul&gt;<br />
</code></p>
<p>In Firefox the regular &lt;a&gt;&#8217;s work just fine, the javascript ones do nothing, even with a simple javascript: alert(&#8220;Hello World&#8221;); as the href attribute.   Is there a workaround for this?</p>
<p>In IE7 everything works as expected.  This has me flummoxed, as I&#8217;m supposed to be able to blame my difficulties on IE; I feel guilty for being upset with FF.</p>
<p>Any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-552009</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Mon, 23 Mar 2009 16:09:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-552009</guid>
		<description>Ross,

Great to hear! :-)</description>
		<content:encoded><![CDATA[<p>Ross,</p>
<p>Great to hear! <img src='http://robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ross</title>
		<link>http://robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-551994</link>
		<dc:creator>Ross</dc:creator>
		<pubDate>Mon, 23 Mar 2009 15:25:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-551994</guid>
		<description>Hi Robert

Thanks for your quick response :D

I was missing the obvious there! 

Its working fine now, thanks again 

Ross</description>
		<content:encoded><![CDATA[<p>Hi Robert</p>
<p>Thanks for your quick response <img src='http://robertnyman.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>I was missing the obvious there! </p>
<p>Its working fine now, thanks again </p>
<p>Ross</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-551849</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Mon, 23 Mar 2009 09:16:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-551849</guid>
		<description>Ross,

In your page receiving the AJAX call, you already use the term to produce the search results, right? Meaning, you can customize any link to Full results in any way you want it in that page too, just add it below the separate search results you already return.</description>
		<content:encoded><![CDATA[<p>Ross,</p>
<p>In your page receiving the AJAX call, you already use the term to produce the search results, right? Meaning, you can customize any link to Full results in any way you want it in that page too, just add it below the separate search results you already return.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ross</title>
		<link>http://robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-550176</link>
		<dc:creator>Ross</dc:creator>
		<pubDate>Sat, 21 Mar 2009 14:20:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-550176</guid>
		<description>Hi

I am currently using your ajax suggestions script on my website, its working amazingly however at the bottom of the search results I would really like to have a link &quot;Full Results&quot; that would allow the user to get more results on a main search page. The problem is that I cant work out how to  update this link with the search term at the end. I noticed you currently have this implemented in the search box on your site so i know its possible, but i just cant figure it out :(

For example the &quot;Full Results&quot; link would update from 

search.php?q=

to

search.php?q=searchKeyword

Thanks for reading :D

Ross</description>
		<content:encoded><![CDATA[<p>Hi</p>
<p>I am currently using your ajax suggestions script on my website, its working amazingly however at the bottom of the search results I would really like to have a link &#8220;Full Results&#8221; that would allow the user to get more results on a main search page. The problem is that I cant work out how to  update this link with the search term at the end. I noticed you currently have this implemented in the search box on your site so i know its possible, but i just cant figure it out <img src='http://robertnyman.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>For example the &#8220;Full Results&#8221; link would update from </p>
<p>search.php?q=</p>
<p>to</p>
<p>search.php?q=searchKeyword</p>
<p>Thanks for reading <img src='http://robertnyman.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Ross</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-501338</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Sat, 17 Jan 2009 19:44:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-501338</guid>
		<description>Mori,

Glad it worked out! Thanks for the tip!</description>
		<content:encoded><![CDATA[<p>Mori,</p>
<p>Glad it worked out! Thanks for the tip!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mori</title>
		<link>http://robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-500877</link>
		<dc:creator>Mori</dc:creator>
		<pubDate>Fri, 16 Jan 2009 21:31:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-500877</guid>
		<description>It actually should be:
&lt;code&gt;$input = array_reverse($input);&lt;/code&gt;
instead of:
&lt;code&gt;rsort($input);&lt;/code&gt;
in my PHP part. Sorry, my bad.</description>
		<content:encoded><![CDATA[<p>It actually should be:<br />
<code>$input = array_reverse($input);</code><br />
instead of:<br />
<code>rsort($input);</code><br />
in my PHP part. Sorry, my bad.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mori</title>
		<link>http://robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-500874</link>
		<dc:creator>Mori</dc:creator>
		<pubDate>Fri, 16 Jan 2009 20:59:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-500874</guid>
		<description>Sorry for triple posting, but I&#039;ve ran into another problem. When entering more than one input item, it would reset my input. I&#039;ve tracked down the problem and it turned out to be because I&#039;ve changed the itemSeparator. I&#039;ve googled some Javascript tutorials, and came up with this replacement:

Replace [around line 295]:
&lt;code&gt;input.value = ((input.value.length &gt; 0 &amp;&amp; /;/i.test(input.value))? (input.value + value) : value) + ajaxSuggestions.itemSeparator;&lt;/code&gt;

With:
&lt;code&gt;if( (input.value.length &gt; 0 &amp;&amp; new RegExp(ajaxSuggestions.itemSeparator, &quot;i&quot;).test(input.value) ) )
{
	var brokenstring=input.value.split(ajaxSuggestions.itemSeparator);
	input.value = &#039;&#039;;
	for (var i = 0; i &lt; (brokenstring.length-1); i++)
	{ 
		input.value += brokenstring[i] + ajaxSuggestions.itemSeparator; 
	} 
	input.value = input.value + value + ajaxSuggestions.itemSeparator;
}&lt;/code&gt;

It seems to be working like a charm, and also takes care of the string you&#039;ve entered and that was searched for (so no more &quot;sugSuggestion&quot; or something like that).

Also, if someone wants to implement this in PHP script and want the suggestion to work only for the last input (separated by itemSeparator, that is), you can do it like me:
&lt;code&gt;$input = trim($_GET[&#039;search&#039;]);
$input = explode(&#039;,&#039;, $input); //insert your itemSeparator here!
rsort($input);
$input = array_shift($input);
$input = trim($input);&lt;/code&gt;

Hope that helps someone.</description>
		<content:encoded><![CDATA[<p>Sorry for triple posting, but I&#8217;ve ran into another problem. When entering more than one input item, it would reset my input. I&#8217;ve tracked down the problem and it turned out to be because I&#8217;ve changed the itemSeparator. I&#8217;ve googled some Javascript tutorials, and came up with this replacement:</p>
<p>Replace [around line 295]:<br />
<code>input.value = ((input.value.length &gt; 0 &amp;&amp; /;/i.test(input.value))? (input.value + value) : value) + ajaxSuggestions.itemSeparator;</code></p>
<p>With:<br />
<code>if( (input.value.length &gt; 0 &amp;&amp; new RegExp(ajaxSuggestions.itemSeparator, "i").test(input.value) ) )<br />
{<br />
	var brokenstring=input.value.split(ajaxSuggestions.itemSeparator);<br />
	input.value = '';<br />
	for (var i = 0; i &lt; (brokenstring.length-1); i++)<br />
	{<br />
		input.value += brokenstring[i] + ajaxSuggestions.itemSeparator;<br />
	}<br />
	input.value = input.value + value + ajaxSuggestions.itemSeparator;<br />
}</code></p>
<p>It seems to be working like a charm, and also takes care of the string you&#8217;ve entered and that was searched for (so no more &#8220;sugSuggestion&#8221; or something like that).</p>
<p>Also, if someone wants to implement this in PHP script and want the suggestion to work only for the last input (separated by itemSeparator, that is), you can do it like me:<br />
<code>$input = trim($_GET['search']);<br />
$input = explode(',', $input); //insert your itemSeparator here!<br />
rsort($input);<br />
$input = array_shift($input);<br />
$input = trim($input);</code></p>
<p>Hope that helps someone.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mori</title>
		<link>http://robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-500182</link>
		<dc:creator>Mori</dc:creator>
		<pubDate>Thu, 15 Jan 2009 14:56:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/04/09/ajax-suggestions-a-new-javascript-library-for-you/#comment-500182</guid>
		<description>zOMG, turns out it was my PHP function fault, not your JS - sorry.</description>
		<content:encoded><![CDATA[<p>zOMG, turns out it was my PHP function fault, not your JS &#8211; sorry.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
