<?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: Getting More From Twitter Bootstrap&#8217;s Typeahead Library</title>
	<atom:link href="https://www.webmaster-source.com/2012/11/07/getting-more-from-twitter-bootstraps-typeahead-library/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.webmaster-source.com/2012/11/07/getting-more-from-twitter-bootstraps-typeahead-library/</link>
	<description>Useful Resources For Webmasters</description>
	<lastBuildDate>Mon, 06 Apr 2026 13:53:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.42</generator>
	<item>
		<title>By: gfdfgdfg</title>
		<link>https://www.webmaster-source.com/2012/11/07/getting-more-from-twitter-bootstraps-typeahead-library/#comment-38901</link>
		<dc:creator><![CDATA[gfdfgdfg]]></dc:creator>
		<pubDate>Tue, 04 Feb 2014 06:24:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.webmaster-source.com/?p=4872#comment-38901</guid>
		<description><![CDATA[dfdsfsdf]]></description>
		<content:encoded><![CDATA[<p>dfdsfsdf</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Krzysztof Wiśniewski</title>
		<link>https://www.webmaster-source.com/2012/11/07/getting-more-from-twitter-bootstraps-typeahead-library/#comment-37185</link>
		<dc:creator><![CDATA[Krzysztof Wiśniewski]]></dc:creator>
		<pubDate>Sun, 14 Jul 2013 18:09:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.webmaster-source.com/?p=4872#comment-37185</guid>
		<description><![CDATA[I&#039;ve found in the Internet and use modified version in my project based on ASP.NET WebApi (MVC4) (web service gives me XML output):

        $(function () {
            $(&#039;#tags&#039;).autocomplete({
                source: function (request, response) {
                    $.ajax({
                        url: &#039;/api/City/GetReterCities&#039;,
                        type: &#039;GET&#039;,
                        cache: false,
                        data: request,
                        dataType: &#039;xml&#039;,
                        success: function (xmlResponse) {
                            var data = $(&#039;ReterCity&#039;, xmlResponse).map(function () {
                                return {
                                    value: $(&#039;CityName&#039;, this).text(),
                                    id: $(&#039;CityId&#039;, this).text()
                                };
                            }).get();
                            $(&#039;#tags&#039;).autocomplete({
                                source: data
                            });
                        },
                        error: function (XMLHttpRequest, textStatus, errorThrown) {
                            console.log(&#039;error&#039;, textStatus, errorThrown);
                        }
                    });
                },
                select: function (event, ui) {
                    alert(&#039;you have selected &#039; + ui.item.value + &#039; ID: &#039; + ui.item.id);
                    $(&#039;#tags&#039;).val(ui.item.label);
                    return false;
                }
            })
        });]]></description>
		<content:encoded><![CDATA[<p>I&#8217;ve found in the Internet and use modified version in my project based on ASP.NET WebApi (MVC4) (web service gives me XML output):</p>
<p>        $(function () {<br />
            $(&#8216;#tags&#8217;).autocomplete({<br />
                source: function (request, response) {<br />
                    $.ajax({<br />
                        url: &#8216;/api/City/GetReterCities&#8217;,<br />
                        type: &#8216;GET&#8217;,<br />
                        cache: false,<br />
                        data: request,<br />
                        dataType: &#8216;xml&#8217;,<br />
                        success: function (xmlResponse) {<br />
                            var data = $(&#8216;ReterCity&#8217;, xmlResponse).map(function () {<br />
                                return {<br />
                                    value: $(&#8216;CityName&#8217;, this).text(),<br />
                                    id: $(&#8216;CityId&#8217;, this).text()<br />
                                };<br />
                            }).get();<br />
                            $(&#8216;#tags&#8217;).autocomplete({<br />
                                source: data<br />
                            });<br />
                        },<br />
                        error: function (XMLHttpRequest, textStatus, errorThrown) {<br />
                            console.log(&#8216;error&#8217;, textStatus, errorThrown);<br />
                        }<br />
                    });<br />
                },<br />
                select: function (event, ui) {<br />
                    alert(&#8216;you have selected &#8216; + ui.item.value + &#8216; ID: &#8216; + ui.item.id);<br />
                    $(&#8216;#tags&#8217;).val(ui.item.label);<br />
                    return false;<br />
                }<br />
            })<br />
        });</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cameron</title>
		<link>https://www.webmaster-source.com/2012/11/07/getting-more-from-twitter-bootstraps-typeahead-library/#comment-36801</link>
		<dc:creator><![CDATA[Cameron]]></dc:creator>
		<pubDate>Wed, 05 Jun 2013 22:56:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.webmaster-source.com/?p=4872#comment-36801</guid>
		<description><![CDATA[Great post, thanks very much! 

I have copied your code but get an error (below) when deleting text using the backspace button.

&quot;SyntaxError: Unexpected token &lt;&quot;

Anyone else getting this?]]></description>
		<content:encoded><![CDATA[<p>Great post, thanks very much! </p>
<p>I have copied your code but get an error (below) when deleting text using the backspace button.</p>
<p>&#8220;SyntaxError: Unexpected token &lt;&quot;</p>
<p>Anyone else getting this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: HideMy</title>
		<link>https://www.webmaster-source.com/2012/11/07/getting-more-from-twitter-bootstraps-typeahead-library/#comment-34886</link>
		<dc:creator><![CDATA[HideMy]]></dc:creator>
		<pubDate>Sun, 07 Apr 2013 23:36:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.webmaster-source.com/?p=4872#comment-34886</guid>
		<description><![CDATA[Hi, you can also edit the template using the option item ex.
item: &#039;&#039;

is it possibile to make some LI selectable and some LI not-selectable?

I would like to create a HEDER to divide the result..

Tnx]]></description>
		<content:encoded><![CDATA[<p>Hi, you can also edit the template using the option item ex.<br />
item: &#8221;</p>
<p>is it possibile to make some LI selectable and some LI not-selectable?</p>
<p>I would like to create a HEDER to divide the result..</p>
<p>Tnx</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Derek</title>
		<link>https://www.webmaster-source.com/2012/11/07/getting-more-from-twitter-bootstraps-typeahead-library/#comment-34562</link>
		<dc:creator><![CDATA[Derek]]></dc:creator>
		<pubDate>Mon, 18 Mar 2013 10:54:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.webmaster-source.com/?p=4872#comment-34562</guid>
		<description><![CDATA[Hi Matt. I&#039;m looking for a way to do something very similar to the above, however when one clicks a result from the dropdown I&#039;d like it to go directly to that result rather than a general search page. Do you have any idea how to achieve this? I&#039;m a coder, but a little rusty trying to get back into web design.

My site will be as follows: a google style search bar with autocomplete, a user searches &#039;Lemon&#039; which will return certain titles in a dropdown e.g. &#039;Lemons are really nice&#039; by searching a MySQL database for any occurrence of &#039;Lemon&#039; in either the title or body (&#039;Lemons are nice because they are lemony.&#039;) Pressing enter with a dropdown entry highlighted will take you directly to the &#039;Lemon&#039; page containing the full body, clicking the search icon however will take you to a page with detailed search results.

Make sense?

I&#039;d appreciate any input. Thanks!]]></description>
		<content:encoded><![CDATA[<p>Hi Matt. I&#8217;m looking for a way to do something very similar to the above, however when one clicks a result from the dropdown I&#8217;d like it to go directly to that result rather than a general search page. Do you have any idea how to achieve this? I&#8217;m a coder, but a little rusty trying to get back into web design.</p>
<p>My site will be as follows: a google style search bar with autocomplete, a user searches &#8216;Lemon&#8217; which will return certain titles in a dropdown e.g. &#8216;Lemons are really nice&#8217; by searching a MySQL database for any occurrence of &#8216;Lemon&#8217; in either the title or body (&#8216;Lemons are nice because they are lemony.&#8217;) Pressing enter with a dropdown entry highlighted will take you directly to the &#8216;Lemon&#8217; page containing the full body, clicking the search icon however will take you to a page with detailed search results.</p>
<p>Make sense?</p>
<p>I&#8217;d appreciate any input. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>https://www.webmaster-source.com/2012/11/07/getting-more-from-twitter-bootstraps-typeahead-library/#comment-30176</link>
		<dc:creator><![CDATA[Matt]]></dc:creator>
		<pubDate>Thu, 31 Jan 2013 21:20:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.webmaster-source.com/?p=4872#comment-30176</guid>
		<description><![CDATA[That&#039;s a pretty good article. It would have saved me a bit of time if they had published it a week or two sooner, before I worked on the project that led to writing this post... :)]]></description>
		<content:encoded><![CDATA[<p>That&#8217;s a pretty good article. It would have saved me a bit of time if they had published it a week or two sooner, before I worked on the project that led to writing this post&#8230; <img src="https://www.webmaster-source.com/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Todd</title>
		<link>https://www.webmaster-source.com/2012/11/07/getting-more-from-twitter-bootstraps-typeahead-library/#comment-30152</link>
		<dc:creator><![CDATA[Todd]]></dc:creator>
		<pubDate>Thu, 31 Jan 2013 18:03:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.webmaster-source.com/?p=4872#comment-30152</guid>
		<description><![CDATA[I got it to work with the help of this article: http://tatiyants.com/how-to-use-json-objects-with-twitter-bootstrap-typeahead/


	$(&#039;#mainsearch&#039;).typeahead({
		minLength: 4,
		source: function (query, process) {
			products = [];
			map = {};
			$.ajax({
				type: &quot;get&quot;,
				url: &quot;/includes/ajax/autocomplete-keyword-search?&quot;,
				data: &quot;q=&quot; + query,
				cache: false,
				dataType: &#039;json&#039;,
				success: function (data) {
					$.each(data, function (i, product) {
						map[product.name] = product;
						products.push(product.name);
						map[product.sku] = product;
						products.push(product.sku);
						map[product.vendor] = product;
						products.push(product.vendor);
					});
			 		return process(products);
				}
			});
		},
		updater: function (item) {
			if (jQuery.type(map[item]) !== &#039;undefined&#039;){
				selectedProduct = map[item].id;
				//console.log(selectedProduct);
				document.location = &quot;/search?id=&quot; + encodeURIComponent(selectedProduct);
			}
			return item;
		},
		matcher: function (item) {
			if (item.toLowerCase().indexOf(this.query.trim().toLowerCase()) != -1) {
				return true;
			}
		},
		sorter: function (items) {
			 items.unshift(this.query);
			 return items;
		}
	});]]></description>
		<content:encoded><![CDATA[<p>I got it to work with the help of this article: <a href="http://tatiyants.com/how-to-use-json-objects-with-twitter-bootstrap-typeahead/" rel="nofollow">http://tatiyants.com/how-to-us.....typeahead/</a></p>
<p>	$(&#8216;#mainsearch&#8217;).typeahead({<br />
		minLength: 4,<br />
		source: function (query, process) {<br />
			products = [];<br />
			map = {};<br />
			$.ajax({<br />
				type: &#8220;get&#8221;,<br />
				url: &#8220;/includes/ajax/autocomplete-keyword-search?&#8221;,<br />
				data: &#8220;q=&#8221; + query,<br />
				cache: false,<br />
				dataType: &#8216;json&#8217;,<br />
				success: function (data) {<br />
					$.each(data, function (i, product) {<br />
						map[product.name] = product;<br />
						products.push(product.name);<br />
						map[product.sku] = product;<br />
						products.push(product.sku);<br />
						map[product.vendor] = product;<br />
						products.push(product.vendor);<br />
					});<br />
			 		return process(products);<br />
				}<br />
			});<br />
		},<br />
		updater: function (item) {<br />
			if (jQuery.type(map[item]) !== &#8216;undefined&#8217;){<br />
				selectedProduct = map[item].id;<br />
				//console.log(selectedProduct);<br />
				document.location = &#8220;/search?id=&#8221; + encodeURIComponent(selectedProduct);<br />
			}<br />
			return item;<br />
		},<br />
		matcher: function (item) {<br />
			if (item.toLowerCase().indexOf(this.query.trim().toLowerCase()) != -1) {<br />
				return true;<br />
			}<br />
		},<br />
		sorter: function (items) {<br />
			 items.unshift(this.query);<br />
			 return items;<br />
		}<br />
	});</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>https://www.webmaster-source.com/2012/11/07/getting-more-from-twitter-bootstraps-typeahead-library/#comment-30018</link>
		<dc:creator><![CDATA[Matt]]></dc:creator>
		<pubDate>Wed, 30 Jan 2013 23:14:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.webmaster-source.com/?p=4872#comment-30018</guid>
		<description><![CDATA[The Bootstrap library only accepts a flat array. You might be able to get it to work by parsing the response and storing the object, then creating a second array with just the names to feed to the process() method. You could then compare &quot;item&quot; against the original object in the updater method.]]></description>
		<content:encoded><![CDATA[<p>The Bootstrap library only accepts a flat array. You might be able to get it to work by parsing the response and storing the object, then creating a second array with just the names to feed to the process() method. You could then compare &#8220;item&#8221; against the original object in the updater method.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Todd</title>
		<link>https://www.webmaster-source.com/2012/11/07/getting-more-from-twitter-bootstraps-typeahead-library/#comment-29251</link>
		<dc:creator><![CDATA[Todd]]></dc:creator>
		<pubDate>Fri, 25 Jan 2013 23:29:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.webmaster-source.com/?p=4872#comment-29251</guid>
		<description><![CDATA[This is great code! But I can&#039;t figure out how to make it work with json name, id data: [{&quot;id&quot;:1528634,&quot;name&quot;:&quot;Tree Mount Screws 5 Pack&quot;}]. I need to do it this way so I can pass the id to a product detail page.
Any ideas? - Thanks!]]></description>
		<content:encoded><![CDATA[<p>This is great code! But I can&#8217;t figure out how to make it work with json name, id data: [{&#8220;id&#8221;:1528634,&#8221;name&#8221;:&#8221;Tree Mount Screws 5 Pack&#8221;}]. I need to do it this way so I can pass the id to a product detail page.<br />
Any ideas? &#8211; Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>https://www.webmaster-source.com/2012/11/07/getting-more-from-twitter-bootstraps-typeahead-library/#comment-27095</link>
		<dc:creator><![CDATA[Steve]]></dc:creator>
		<pubDate>Wed, 09 Jan 2013 23:21:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.webmaster-source.com/?p=4872#comment-27095</guid>
		<description><![CDATA[The updater override was exactly what I needed. Thanks for posting this!]]></description>
		<content:encoded><![CDATA[<p>The updater override was exactly what I needed. Thanks for posting this!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/


Served from: www.webmaster-source.com @ 2026-04-25 14:25:21 by W3 Total Cache
-->