Wednesday, December 29, 2010

The 10 Most Significant Gadgets of 2010 | Gadget Lab

Steve Jobs and iPad

When this year began, we were feverishly speculating about an Apple tablet, looking forward to 3-D TV sets, and optimistically waiting for the end of the cable companies' cruel grip on our wallets.

We had to settle for one out of three. While manufacturers did release a handful of 3-D TVs, there's just not enough content (either on cable or Blu-ray) to justify purchasing one yet. The heavy, expensive glasses you need to buy don't make the proposition any more attractive, either.

And as for getting all our video from the sweet, ever-flowing bounty of the internet? Sure, we still do that — when we're at work. But at home, internet TV is still struggling to stand on its own. The gadget we'd pinned our hopes on, the Boxee Box, is unfinished and buggy. Google TV is hampered by the unwillingness of the TV networks to play ball. Apple TV remains locked into its own little iTunes-centric world.

So that leaves the Apple tablet. If you'd told us in December 2009 that we'd be using the word "iPad" every day without giggling, well, we would have giggled at you. But there it is: There's no getting around the fact that the iPad, silly name and all, has completely and successfully redefined what a "tablet computer" could be.

But the iPad was far from being the only big gadget news of the year. E-readers, cameras, and even exoskeletons made huge strides in 2010. Here, then, are the 10 gadgets that were most significant in 2010.

<< Previous | Next >>

Tuesday, December 21, 2010

Android comes to landline phones - News - Linux for Devices

At CeBIT this week, Motorola demonstrated an Android-based "HS1001" cordless IP phone manufactured by Binatone and built around the DSP Group's DECT-compatible XpandR chipset. Meanwhile, DSP Group showed its own Android-based IP phone reference design based on the XpandR II chipset.

For much of the last decade, Linux-based landline-based IP phones made regular appearances on LinuxDevices, but with the rise of mobile phones, such announcements have become fewer and farther between. The few IP phones we've covered recently are typically multimedia tablet/kitchen-computer designs, such as the already defunct, Linux-based Verizon Hub, built by OpenPeak, OpenPeak's Linux-based OpenFrame IP phone, or the Android-based Glass reference platform from Cloud Telecomputers. Typically, in these designs, IP telephony is just one feature among many other multimedia and Web browsing capabilities.


Motorola HS1001

Now several vendors are bringing Android to smaller-screen cordless phones that adhere to the Digital Enhanced Cordless Telecommunications (DECT) standard for portable digital phones. According to several sources, -- including DECT chipset manufacturer DSP Group, which supplied the photo above -- Motorola is preparing an Android- and DECT-based HS1001 phone manufactured for it Binatone.

According to DSP Group, Hong Kong-based Binatone chose the DSP Group’s XpandR chipset for the HS1001 "multimedia cordless home phone," which will be sold by Motorola. The company claims that its XpandR chipset is the world's only system-on-a-chip (SoC) to support both WiFi and DECT 6.0, both of which are available on the HS1001.

The HS1001 also provides Android-based email, web browsing, and a touchscreen interface with a virtual keyboard, says DSP Group. The phone will be available in the third quarter in the U.S., the company adds.

No more information was apparent from Motorola. Binatone, or DSP Group, but Engadget and others have posted stories from the floors of the CeBIT show in Hannover, Germany this week reporting on Motorola's demo of the phone. According to Engadget, the HS1001 will be Motorola branded and sell for around $150.

It's said the phone will feature a 2.8-inch touchscreen, and is available with a speaker-equipped charging station that offers music playback. Based on Android 1.6, the phone will not have access to the Android Marketplace for app downloads, and Skype is not available, says the story.

DSP Group Android Home Phone

While furnishing an XpandR I chipset to Binatone and Motorola for the HS1001, DSP Group uses its next generation XpandR II chipset for its own customizable Android Home Phone reference design. The XpandR II combines a 240MHz ARM9 core, a 16-bit TeakLite DSP, and a novel baseband processor that combines WiFi and DECT 6.0 support with CAT-IQ extensions. (Cat-IQ is a broadband-oriented follow-on standard developed by the DECT Forum to enable cordless DECT phones to be used for VoIP and other Internet-based services, including streaming audio and video.)

DSP Group Android Home Phone reference design
(Click to enlarge)

XpandR II is available with a Linux-based software development kit that incorporates Qt Software's Qtopia framework (see diagram below). The company also supplies a related hardware development kit.

DSP Group supplies the SDK with the Home Phone design, along with Android extensions and sample applications. The latter include apps for turning the reference design into a universal remote, a home automation monitor, and a general-purpose DLNA-ready storage management device. The design is also said to ship with a VoIP software suite.


XpandR II SDK architecture

The DSP Group Home Phone design features a 3.5-inch touchscreen and offers 802.11b/g WiFi, as well as a USB port, keypad, and accelerometers, says the company. Its 1350 mAh Li-Ion battery is claimed to offer 10 hours of DECT talk time and five hours of streaming WiFi content. The phone is also claimed to offer video playback, although quality is not likely to be great on an ARM9 clocked at 240MHz, even if the DSP is contributing.

Monday, December 20, 2010

Facebook Connect - PHP Classes

Detailed description

This class can be used to authenticate Facebook users using Facebook Connect.

It displays a Facebook Connect button to let the users click and be lead to a Facebook page on which they may authorize your application to obtain access to the Facebook user accounts.

The user browser is redirected to a configurable page on which applications may access the authorized user account details.

Saturday, December 18, 2010

Analysis: Software M&A heats up as firms battle budget squeeze | Reuters

A man walks past the headquarters of IBM Japan in Tokyo in this March 18, 2010 file photo. REUTERS/Toru Hanai

By Paul Sandle and Tricia Wright

LONDON | Fri Dec 17, 2010 1:17pm EST

LONDON

(Reuters) - Big-name technology firms will compete to acquire niche software groups in 2011 as part of a growth plan they hope will cater to recession-hit clients clamoring for a wider range of services.

Having learned the lessons of the dot-com bubble collapse in 2000, technology companies were quick to cut headcount -- their biggest cost -- at the start of the downturn.

And with revenues returning to growth, they have pockets full of cash at their disposal.

Major companies, such as IBM (IBM.N) and Oracle (ORCL.O), are buying specialist software makers so they can offer more to corporate customers who need to cut IT budgets, thereby holding on to high margin, long-term maintenance contracts.

"Companies ...need to offer a portfolio of products," Panmure Gordon analyst George O'Connor said. "They will ask 'what additional services can I sell to my customers, thereby increasing my wallet share'."

Ernst & Young estimated the top 10 global technology companies had about $290 billion cash on their balance sheets at the end of June -- a number that partner Karl Havers said was "amazing, and a sign of things to come."

Oracle alone has spent more than $42 billion on acquisitions over the past six years, and it had $10.4 billion in cash at the end of November.

"Many of these new things will be most profitably done on a very large scale, and the smaller companies who are generating these great new ideas may not have the capital to do that," said Havers.

"The tech sector has been good through this downturn in conserving cash and managing costs," Conor Cahill, Deloitte's technology corporate finance partner said.

"With revenues recovering, the companies need to find a use for this money, and they are looking to place bets on emerging technologies."

EUROPE IN THE SPOTLIGHT

European deals are recovering but have a long way to go to catch up with pre-recession levels. That said, though it may be early days in the M&A recovery, premiums are rising fast as the field becomes more crowded.

The total value of deals in European technology by mid-December 2010 was $19.9 billion, up 7.5 percent on 2009, but still only 36 percent of the $54.7 billion of deals in 2007 before a global downturn, according to Thomson Reuters data.

Global acquirers stumped up nearly three times revenue and just under 20 times adjusted core earnings in the second half, both at the highest level for two years, according to Deloitte's UK Technology M&A survey.

The biggest premiums so far have been in U.S. deals, such as IBM buying Unica to offer more marketing software to corporate clients, and Hewlett-Packard beating Dell to buy data storage company 3PAR.

Sunday, December 5, 2010

Facebook | Introducing the New Profile

Today I'm excited to introduce you to some improvements we've made to the Facebook profile, so now it's even easier for you to tell your story and learn about your friends.

 

A New Introduction

The profile begins with a quick overview of basic information such as where you're from, where you went to school, and where you work—the kinds of conversation starters you share with people you've just met or exchange with old friends as you get reacquainted.

 

And since there's often no better way to learn about a person than through photos, the profile now includes a row of recently tagged photos of you. In my case, my profile features pics from my engagement and wedding, two of my life's most recent and happiest moments.

 

 

Featured Friends

You can now highlight the friends who are important to you, such as your family, best friends or teammates. Create new groups of friends, or feature existing friends lists. I opted to feature my Ultimate Frisbee teammates, giving the rest of my friends a way to learn more about that part of my life.

 

 

New Experiences

The profile also gives you new ways to share your interests and activities. You can list the projects you worked on at your job, classes you took in school, your favorite musicians and sports teams, and more. You can also share your life philosophy by connecting to the religions, political affiliations, and people you follow and admire. All your interests and experiences are now represented with images, making your entire profile a more compelling visual experience.

 

Personally, I opted to add this profile project to my work history at Facebook, and I tagged the people who worked on it with me. I also added "Ultimate Frisbee" as one of the sports I play and included a description of my team's victories at the USA Ultimate National Championships and World Championships.

 

 

Improved Photos and Friends Pages

Thanks to the cool new "infinite scroll" feature, it's now much faster and more fun to browse all your photos. The Friends page now allows you to quickly find the people you're looking for: just search by name, hometown, school or a number of other dimensions. I met a ton of new Ultimate players at Nationals, and the new profile has made it so much easier to locate and learn about them.

 

We're really excited about the new profile.  We're rolling it out gradually and plan to get it to everyone by early next year.  You can upgrade immediately or learn more about the new features on this page: www.facebook.com/about/profile.

 



 

 

Josh Wiseman, a Facebook engineer, is reassuring his wife Kelly that the wedding was more exciting than any Ultimate Frisbee tournament.

Wednesday, December 1, 2010

Facebook Co-Founder Launches Non-Profit Platform Called Jumo

Today, Facebook co-founder and My.BarackObama.com alum Chris Hughes announced the soft launch of Jumo, his new philanthropic start-up that works to match do-gooders with appropriate causes. Currently, the Jumo site is merely an elegantly designed homepage that announces Hughes’s mission to “bring together everyday individuals and organizations to speed the pace of global change. We connect people to the issues, organizations, and individuals relevant to them to foster lasting relationships and meaningful action.” Hughes told us, however, that the site will later be organized much like a social network — with profiles for individual users that contain a collection of information that they have shared and used, pages for organizations created both by the orgs in question and others, and issue pages that serve as a kind of discussion of the topics at hand. Hughes says that the idea is to make sure that Jumo can get the most relevant information possible to its users, so that they can foster on-going relationships with social organizations to do the most good. As a result, the current homepage features a rather intriguing survey box that asks the site visitor an array of questions from, “If you had a daughter tomorrow, which would you name her?” to “Would you say the world is getting better or worse?” Upon answering these queries, you can also submit your e-mail address to get more information as it comes. The site itself came about after a period of reflection on Hughes’s part. The Obama campaign came and went, and he started thinking about how he could apply social media principles gleaned from FacebookFacebook and My.BarackObama.com to have the maximum impact on the world. While he was impressed by efforts following catastrophes like the earthquake in Haiti, Hughes thought we could be doing more. “I think watching what happened after Haiti was hard for everyone,” he says. “The fact that so much money was raised is just a testament to the fact that people really do care and help.” Still, he applies the “don’t just give during the holidays — give all year round” principle to the situation. “I was frustrated to see that moment of engagement not functioning as part of a much larger process of supporting those organizations to help ensure that tragedies like Haiti not happen again,” he said. Currently, Hughes is hiring a team to run the site from its Soho office. According to the job posting, he’s “looking to hire hard-working individuals who value intellectual challenge, appreciate the importance of online networking technology, and, most importantly, want to change the world.”

WordPress › WordPress 3.0.2

WordPress 3.0.2 is available and is a mandatory security update for all previous WordPress versions. Haiku has become traditional:

Fixed on day zero
One-click update makes you safe
This used to be hard

This maintenance release fixes a moderate security issue that could allow a malicious Author-level user to gain further access to the site, addresses a handful of bugs, and provides some additional security enhancements. Big thanks to Vladimir Kolesnikov for detailed and responsible disclosure of the security issue!

Download 3.0.2 or update automatically from the Dashboard > Updates menu in your site’s admin area. You should update immediately even if you do not have untrusted users.

Tuesday, November 30, 2010

Google's Secret Social Initiative Delayed Until Spring 2011 [EXCLUSIVE]

Google’s big social initiative, once thought to be a full-fledged social network named “Google Me,” is experiencing delays that have pushed back the launch until spring 2011.

MashableMashableMashable has learned that Google’s big social play could debut in March or April, a far cry from earlier rumors that pegged a 2010 launch date.

The project is a top-secret affair, even within the company. It is being led by Vic Gundotra, one of the company’s public faces and a VP of engineering.

“We’re always experimenting with new ways to improve our products, and we have already confirmed that we are focused on incorporating social elements across Google,” a Google spokesperson told us when reached for comment. “But we have nothing new to announce at this time.”

The rumors were running wild earlier this year about Google Me. According to chatter, at the time, it was going to be a “full, first-class social network” designed as a direct competitor to FacebookFacebookFacebook. A few months later though, GoogleGoogleGoogle CEO Eric Schmidt stated that the company is actually building social components into Google’s core products.

“If you think about it, it’s obvious. With your permission, knowing more about who your friends are, we can provide more tailored recommendations. Search quality can get better,” Schmidt said at the time.

So what is causing the delay? The likely culprit is disagreement on the design, purpose and execution of the project. One of our sources told us that he/she has heard “tales of disorganization and too many different teams working parallel or in conflict.”

Google’s social initiative was sparked by the threat Facebook presented to its domination of the web. Facebook’s growth has spooked Google’s leadership. When Facebook learned of the search giant’s plans, it responded by entering “lockdown” for 60 days, where the company focused on completing new features like Facebook Messages, Facebook Places and Facebook Groups.

Beyond YouTubeYouTubeYouTube, Google has a poor track record in social, part of the reason why it acquired Slide and Ã…ngströ. The delay of Google’s big social initiative is yet another black eye for the company and another win for a certain social network based out of Palo Alto.

Microsoft Files for Patent on Touchy-Feely Screens

Microsoft Files for Patent on Touchy-Feely Screens

A recent Microsoft patent could add a new dimension to touchscreen technology. The concept uses light-induced shape-memory polymers that would allow the screen to actually change its topography with the image, providing the sensation of touching actual buttons. Don't expect to see it on the next Windows Phone, though -- practical uses for such an invention are still years away.

Microsoft (Nasdaq: MSFT) has filed a patent application for a display screen that would dynamically give users the feeling of pushing buttons when they touch it.

It filed patent application 20100295820 last week.

The patent's for a "light-induced shape-memory polymer display screen" that would give users the sensation of actually touching buttons as they're displayed on a touchscreen.

At least one other project that would give users tactile sensations when they put their fingers on a touchscreen is under way elsewhere.

Microsoft Explores Your Feelings

Microsoft's patent describes a device with a display screen that has a topography-changing layer. This layer would consist of a shape-memory polymer activated by light. It would have an imaging engine that would project visible light onto a display screen and a topography-changing engine projecting ultraviolet (UV) light onto the screen.

The UV light would, in essence, command the shape-memory layer to create buttons on the screen as required. This could provide a virtual keyboard users can interact with.

The screen would also have a reference engine that would project infrared (IR) light onto the screen and a touch-detection engine that would detect when the screen was touched. The lights would impact the polymer layer pixel by pixel.

Microsoft's patent proposes using cinnamic acid groups for light detection. The E-isomeric form of cinnamic acid can be converted to the Z-isomer through irradiation with UV light. The technology would apparently be used first in large devices.

"A simple application would be to use this technology to create a true tactile touch keyboard where you could actually feel the keys under your fingers," Carl Howe, director of anywhere consumer research at the Yankee Group, told TechNewsWorld.

Microsoft declined comment on the patent.

Other Efforts With Touchscreen Technology

Disney Research in Pittsburgh, Penn., is also working on a project to provide tactile feedback to touchscreens.

Its TeslaTouch project uses the electrovibration principle to provide tactile feedback to users of a touchscreen. Electrovibration, like mechanical vibration, it is a type of tactile sensation.

A handheld prototype was created in collaboration with Mark Baskinger of the Carnegie-Mellon University School of Design.

The prototype measures 35 by 4 by 40 mm and uses 8 volts of electricity to generate tactile feedback. An electrostatic force attracts the user's fingers to the interactive surface, so the user doesn't receive an electric charge. The input signal is spread uniformly across the touch surface.

TeslaTouch technology can be added to devices ranging from small handheld items to large multitouch collaborative surfaces. However, the user must be grounded for best results. For larger devices, this can be achieved by users wearing antistatic wristbands or sitting or standing on grounded pads. For mobile devices, the back of the device's case serves to ground it when the user holds the device.

Uses of Tactile Feedback

It's difficult right now to predict exactly where this type of tactile technology might be used on a large scale.

"Ideally, this would be for devices with screens which come closer to laptops and smartphones than they do to desktops," Rob Enderle, principal analyst at the Enderle Group, told TechNewsWorld.

"However, initially monitors for existing PCs and other devices are more likely to be easier to use with this technology because the initial cost of the panel will likely limit the market significantly," he added.

The design is part of the problem with the technology.

"The patent puts several constraints on the display and, as of now, I don't see such constrained displays -- ones where have multiple projectors behind them -- having a ton of utility," the Yankee Group's Howe pointed out.

However, there might be niche applications, such as in the command and control center of a battleship, where the tactile feedback would help users remain oriented while the vessel is pitching and yawing, Howe suggested.

However, practical use for the technology might be some ways off.

"It'll likely be seven to 10 years before the technology exists outside the lab in limited runs and over 10 years before it hits the broader market," Enderle opined.

Saturday, November 27, 2010

Join the TBTT Pakistan SMS Group & help fight VAW « In the Line of Wire

Today marks the beginning of the 16 Days of Activism against Gender Based Violence. Join the Take Back the Tech! team in spreading awareness regarding this issue & discussing how we can eradicate this menace from our society and the world.

From November 25 to December 10 Take Back The Tech! calls on women and men to take control of technology to protect the right to freedom of expression and information. Since it began in 2006, campaigners in more than 30 countries have used the internet, mobile phones, radio and more to document and fight violence against women.

Our friends at SMSAll have created the two premium groups for us (not case sensitive):
  • TBTT
  • TBTT-Discuss
The first group is a broadcast group and the second one is a discussion group. On the broadcast group, the TBTT Pakistan camp will send messages regarding the campaign to all those who opt-in and join our group (notifications etc) and on the second group, all members can send messages to the whole group (many-to-many conversation). So no spamming. If you are interested in this issue (and you should be), join hands with us now.
Here are some more details:
To join any group, just send the following:
  • join tbtt

or

  • join tbtt-discuss

to the following numbers:

Service numbers:
  • 5566
  • 03124117660-8 (For Mobilink users only)
To send a message on the groups, users have to include the group name with a “dot” -> “.” at the start of the message. For example, to send a message on the group TBTT, use the following syntax:
.tbtt


Thursday, November 25, 2010

Google Wave Comes Back From the Dead

Google Wave, which was though to be all but extinct after Google ended development on the project, has been given new life, thanks to Apache.

Once considered the e-mail killer, Google WaveGoogle WaveGoogle Wave was one of the most-hyped launches of 2009. I’ll be the first to admit that I got swept up by the excitement.

At the time of launch though, I said that Google Wave would either succeed spectacularly or completely bomb. Unfortunately, my latter prediction came true: Google’sGoogleGoogle realtime communication tool was a failure. Thus, Google shut the project down, open-sourced the code and released Wave as Wave in a Box.

That was supposed to be the end of the story, but now Google Wave has resurfaced in a new proposal to the Apache Software Foundation. Best known for the Apache server, the ASF is host to over 100 open source projects. Several people from Google, Novell, SAP and even the U.S. Navy hope to add “Apache Wave” to that list.

The proposal’s three goals are to migrate Wave’s codebase from Google to the ASF’s infrastructure, to get Wave back to a state where development can be continued and to add new committers to the project. While the proposal notes that there is a risk to adopting Wave as an ASF project (it notes that Wave didn’t gain sufficient traction at Google), it also claims that its use by the U.S. Navy and other adopters makes it a worth project.

Apache Wave is still a proposal though; the ASF still has to accept the project. With a well-developed codebase and some big committers, we expect that this project will see the light of day. If it does, Wave will have been given a second life.

Monday, November 22, 2010

AutoSuggest jQuery Plugin

Download Source Code

AutoSuggest

Version 1.4 5403 Downloads
Need Help? Community Forums
Using this? Donate Now

UPDATE: Version 1.4 Released (Mar. 23, 2010). Get the latest! Details below.

So I needed to add some auto-completing functionality to my project Build It With Me. I figured it would be easy to find a ready-made jQuery plugin to do the work for me. I was wrong.
Naturally I took it upon myself to solve this problem for all of you :) I created this plugin to be as general purpose as possible. As a result it ended up being vastly more customizable than any other jQuery auto-complete plugin. Not only that, I am using actual jQuery. For some reason all the other "jQuery" plugins don't really take advantage of the radness that is jQuery. Consequently, my plugin ended up being dramatically smaller in size (way less code). Just 7kb 8.8kb minified and only 6kb packed. Have fun with it!
AutoSuggest is a very lightweight jQuery plugin that makes auto-completing extremely easy.

Example

Type the letter 'm' into the box below:

Feature Overview Videos

Feature Update for Version 1.3

Initial Feature Overview for Version 1.0

How It Works

AutoSuggest will turn any regular text input box into a rad auto-complete box. It will dynamically create all the HTML elements that it needs to function. You don't need to add any extra HTML to work with AutoSuggest. Also, AutoSuggest uses ZERO images! All styling is done 100% in the included CSS file. This means it is super easy to customize the look of everything! You only need to edit the included CSS file. You can even use images if you want, just add the appropriate lines of code into the CSS file.

As you type into the AutoSuggest input box, it will filter through it's Data and "suggest" matched Data items to you. You can pass in an Object of Data to AutoSuggest or you can have it call a URL as you type to get it's Data from. AutoSuggest will display the matched Data items in a selectable list, which is 100% customizable. You have the option of structuring the HTML elements of that list however you want via the formatList callback function. You case an example of this in the second example above.

When you type into the input box and the "suggestion" dropdown list appears, a few things happen:

  • A class of "loading" is applied to the main AutoSuggest ul while the data is loaded. That class is then removed when all processing has finished and before the suggestion results list is made visible.
  • As you hover over each suggested option in the list a class of "selected" is added to that item, and then removed when you mouseout.
  • When you make a selection the item is added to the input box. Also there is a hidden input field generated for each AutoSuggest box that stores the values (comma separated) of each item you have selected. This input box will have a unique ID as well as a class name of "as-values".

The plugin expects the Data passed into it (or gathered from the URL) to be formatted in JSON. JSON is an extremely easy format to work with, and if you don't already... you should :) To learn more about JSON, check out my post/video, An Introduction to JSON.

When an AJAX request is made the search string is sent over in a param named "q" by default. However you can change that name with the queryParam option. Here is a default example AJAX request: http://www.mysite.com/your/script/?q=mick
"mick" would be the search query that was typed into the input box. Be sure to setup your server-side code to grab that param and send back some results.

As of AutoSuggest version 1.4 you can now create selections by using the tab or comma keys. To do this simply type something into the box and hit the tab or comma keys. The selection is added to AutoSuggest in the exact same manner as if it were chosen from the Results dropdown.

AutoSuggest has been tested (and works) in: IE7 & IE8, Firefox, Safari, Opera, and Chrome.

How To Use It

Obviously you need to make sure you have the latest jQuery library (at least 1.3) already loaded in your page. After that it's really simple, just add the following code to your page (make sure to wrap your code in jQuery's ready function):

1.$(function(){
2.    $("input[type=text]").autoSuggest(data);
3.});

The above line of code will apply AutoSuggest to all text type input elements on the page. Each one will be using the same set of Data. If you want to have multiple AutoSuggest fields on your page that use different sets of Data, make sure you select them separately. Like this:

1.$(function(){
2.    $("div.someClass input").autoSuggest(data);
3.    $("#someID input").autoSuggest(other_data);
4.});

Doing the above will allow you to pass in different options and different Data sets.

Below is an example of using AutoSuggest with a Data Object and other various options:

01.var data = {items: [
02.    {value: "21", name: "Mick Jagger"},
03.    {value: "43", name: "Johnny Storm"},
04.    {value: "46", name: "Richard Hatch"},
05.    {value: "54", name: "Kelly Slater"},
06.    {value: "55", name: "Rudy Hamilton"},
07.    {value: "79", name: "Michael Jordan"}
08.]};
09.$("input[type=text]").autoSuggest(data.items, {selectedItemProp: "name", searchObjProps: "name"});

Below is an example using a URL to gather the Data Object and other various options:

1.$("input[type=text]").autoSuggest("http://mysite.com/path/to/script", {minChars: 2, matchCase: true});

Please not that you MUST have an object property of "value" for each data item. (This is now configureable with the selectedValuesProp option). The "value" property will be stored (comma separated) in the hidden input field when chosen from the "suggestion" dropdown list. You can see an example of the "value" property being set for each data item in the example above. Typically the "value" property would contain the ID of the item, so you can send a list of "chosen" IDs to your server.

Below is an example of how to process the data sent via AJAX to your server in PHP:

01.<?
02.    $input = $_GET["q"];
03.    $data = array();
04.    // query your DataBase here looking for a match to $input
05.    $query = mysql_query("SELECT * FROM my_table WHERE my_field LIKE '%$input%'");
06.    while ($row = mysql_fetch_assoc($query)) {
07.        $json = array();
08.        $json['value'] = $row['id'];
09.        $json['name'] = $row['username'];
10.        $json['image'] = $row['user_photo'];
11.        $data[] = $json;
12.    }
13.    header("Content-type: application/json");
14.    echo json_encode($data);
15.?>

Options

  • asHtmlID: string (false by default) - Enables you to specify your own custom ID that will be appended to the top level AutoSuggest UL element's ID name. Otherwise it will default to using a random ID. Example: id="CUSTOM_ID". This is also applies to the hidden input filed that holds all of the selected values. Example: id="as-values-CUSTOM_ID"
  • startText: string ("Enter Name Here" by default) - Text to display when the AutoSuggest input field is empty.
  • emptyText: string ("No Results" by default) - Text to display when their are no search results.
  • preFill: object or string (empty object by default) - Enables you to pre-fill the AutoSuggest box with selections when the page is first loaded. You can pass in a comma separated list of values (a string), or an object. When using a string, each value is used as both the display text on the selected item and for it's value. When using an object, the options selectedItemProp will define the object property to use for the display text and selectedValuesProp will define the object property to use for the value for the selected item. Note: you must setup your preFill object in that format. A preFill object can look just like the example objects laid out above.
  • limitText: string ("No More Selections Are Allowed" by default) - Text to display when the number of selections has reached it's limit.
  • selectedItemProp: string ("value" by default) - Name of object property to use as the display text for each chosen item.
  • selectedValuesProp: string ("value" by default) - Name of object property to use as the value for each chosen item. This value will be stored into the hidden input field.
  • searchObjProps: string ("value" by default) - Comma separated list of object property names. The values in these objects properties will be used as the text to perform the search on.
  • queryParam: string ("q" by default) - The name of the param that will hold the search string value in the AJAX request.
  • retrieveLimit: number (false by default) - If set to a number, it will add a '&limit=' param to the AJAX request. It also limits the number of search results allowed to be displayed in the results dropdown box.
  • extraParams: string ("" by default) - This will be added onto the end of the AJAX request URL. Make sure you add an '&' before each param.
  • matchCase: true or false (false by default) - Make the search case sensitive when set to true.
  • minChars: number (1 by default) - Minimum number of characters that must be entered into the AutoSuggest input field before the search begins.
  • keyDelay: number (400 by default) - Number of milliseconds to delay after a keydown on the AutoSuggest input field and before search is started.
  • resultsHighlight: true or false (true by default) - Option to choose whether or not to highlight the matched text in each result item.
  • neverSubmit: true or false (false by default) - If set to true this option will never allow the 'return' key to submit the form that AutoSuggest is a part of.
  • selectionLimit: number (false by default) - Limits the number of selections that are allowed to be made to the number specified.
  • showResultList: true or false (true by default) - If set to false, the Results Dropdown List will never be shown at any time.
  • start: callback function - Custom function that is run only once on each AutoSuggest field when the code is first applied.
  • selectionClick: callback function - Custom function that is run when a previously chosen item is clicked. The item that is clicked is passed into this callback function as 'elem'.
    Example: selectionClick: function(elem){ elem.fadeTo("slow", 0.33); }
  • selectionAdded: callback function - Custom function that is run when a selection is made by choosing one from the Results dropdown, or by using the tab/comma keys to add one. The selection item is passed into this callback function as 'elem'.
    Example: selectionAdded: function(elem){ elem.fadeTo("slow", 0.33); }
  • selectionRemoved: callback function - Custom function that is run when a selection removed from the AutoSuggest by using the delete key or by clicking the "x" inside the selection. The selection item is passed into this callback function as 'elem'.
    Example: selectionRemoved: function(elem){ elem.fadeTo("fast", 0, function(){ elem.remove(); }); }
  • formatList: callback function - Custom function that is run after all the data has been retrieved and before the results are put into the suggestion results list. This is here so you can modify what & how things show up in the suggestion results list.
  • beforeRetrieve: callback function - Custom function that is run right before the AJAX request is made, or before the local objected is searched. This is used to modify the search string before it is processed. So if a user entered "jim" into the AutoSuggest box, you can call this function to prepend their query with "guy_". Making the final query = "guy_jim". The search query is passed into this function. Example: beforeRetrieve: function(string){ return string; }
  • retrieveComplete: callback function - Custom function that is run after the ajax request has completed. The data object MUST be returned if this is used. Example: retrieveComplete: function(data){ return data; }
  • resultClick: callback function - Custom function that is run when a search result item is clicked. The data from the item that is clicked is passed into this callback function as 'data'.
    Example: resultClick: function(data){ console.log(data); }
  • resultsComplete: callback function - Custom function that is run when the suggestion results dropdown list is made visible. Will run after every search query.

The formatList option will hand you 2 objects:

  • data: This is the data you originally passed into AutoSuggest (or retrieved via an AJAX request)
  • elem: This is the HTML element you will be formatting (the 'result' li item).
In order to add extra things to the 'result' item (like an image) you will need to make sure you pass that data into AutoSuggest.
Below is an example of formatList in action:
1.formatList: function(data, elem){
2.    var my_image = data.image;
3.    var new_elem = elem.html("add/change stuff here, put image here, etc.");
4.    return new_elem;
5.}

You MUST return the HTML object. formatList will run on each 'result' item.

ChangeLog

Version 1.4 (Mar. 23, 2010)
Changes:
  • When using asHtmlID, the "as-input-" is no longer prepended to the beginning of the ID name. It is now just whatever you set for asHtmlID. This adds easy Rails compatibility.
New Features:
  • Added the ability to generate new selections by hitting tab or comma after entering some text into the main input field. This was a hugely requested feature, and will make AutoSuggest even more useful.
  • Added showResultList which gives you the option to never show a results list at any time.
  • Added in beforeRetrieve callback function (see 'Options' section above for description).
  • Added in selectionAdded callback function (see 'Options' section above for description).
  • Added in selectionRemoved callback function (see 'Options' section above for description).
Version 1.3 (Feb. 07, 2010) - (watch update video above for more details)
Changes:
  • Added a new feature overview video!
  • The hidden input field that holds all the values (class name of 'as-values') now has it's own ID, defined by the asHtmlID option. Example: id="as-values-CUSTOM_ID". If the asHtmlID is not set, it will revert to a random number ID identifier ("as-values-RANDOM").
  • Changed the option selectedItem to selectedItemProp to make better sense.
  • Changed the option searchObj to searchObjProps to make better sense.
  • Changed "Lucdia Grande" to "Lucida Grande" in CSS (bug fix).
  • Fixed bug that would prevent you from adding certain selections at seemingly random times.
New Features:
  • Added preFill option that allows you to pre-fill the AutoSuggest box with selections when the page is loaded.
  • Added asHtmlID option that allows you to specify your own custom ID that will be appended to the top level AutoSuggest UL element's ID name. Otherwise it will default to using a random ID.
  • Added emptyText option to customize "No Results" text.
  • Added resultsHighlight option to choose whether or not to highlight the matched text in the result items.
  • Added neverSubmit option. This will never allow the 'return' key to submit the form that AutoSuggest is a part of.
  • Added resultClick callback function. This will run a custom function when a result item has been clicked. It also hands you the data associated with that result item.
  • Added selectionLimit option so you can limit the number of selections that are allowed to be made.
  • Added limitText option to customize "No More Selections Are Allowed" text.
  • retrieveLimit now works with local objects and will limit the results to the number specified.
  • Added selectedValuesProp option to specify the property you want to use to store the values into the hidden input field.
  • Added in dynamic width for the results UL (description in video above).
  • Added packed version of the JS (only 6kb!)
Version 1.2 (Jan. 05, 2010)
  • Fixed bug that didn't properly use the selectedItem option as the text for the results list (thanks @Niki for finding it).
  • searchObj now has it's white-space removed so it will no longer error if you do: searchObj: "value, prop, cool".
  • Also, added in selectionClick callback function (see 'Options' section above for description).
Version 1.1 (Jan. 02, 2010)
  • Fixed CSS and visuals for Firefox 3.0.
  • Added in the following options: queryParam, extraParams
Version 1.0 (Dec. 28, 2009)
  • Initial release.

AutoSuggest jQuery Plugin | Drewwilson.com

Download Source Code

AutoSuggest

Version 1.4 5403 Downloads
Need Help? Community Forums
Using this? Donate Now

UPDATE: Version 1.4 Released (Mar. 23, 2010). Get the latest! Details below.

So I needed to add some auto-completing functionality to my project Build It With Me. I figured it would be easy to find a ready-made jQuery plugin to do the work for me. I was wrong.
Naturally I took it upon myself to solve this problem for all of you :) I created this plugin to be as general purpose as possible. As a result it ended up being vastly more customizable than any other jQuery auto-complete plugin. Not only that, I am using actual jQuery. For some reason all the other "jQuery" plugins don't really take advantage of the radness that is jQuery. Consequently, my plugin ended up being dramatically smaller in size (way less code). Just 7kb 8.8kb minified and only 6kb packed. Have fun with it!
AutoSuggest is a very lightweight jQuery plugin that makes auto-completing extremely easy.

Example

Type the letter 'm' into the box below:

Feature Overview Videos

Feature Update for Version 1.3

Initial Feature Overview for Version 1.0

How It Works

AutoSuggest will turn any regular text input box into a rad auto-complete box. It will dynamically create all the HTML elements that it needs to function. You don't need to add any extra HTML to work with AutoSuggest. Also, AutoSuggest uses ZERO images! All styling is done 100% in the included CSS file. This means it is super easy to customize the look of everything! You only need to edit the included CSS file. You can even use images if you want, just add the appropriate lines of code into the CSS file.

As you type into the AutoSuggest input box, it will filter through it's Data and "suggest" matched Data items to you. You can pass in an Object of Data to AutoSuggest or you can have it call a URL as you type to get it's Data from. AutoSuggest will display the matched Data items in a selectable list, which is 100% customizable. You have the option of structuring the HTML elements of that list however you want via the formatList callback function. You case an example of this in the second example above.

When you type into the input box and the "suggestion" dropdown list appears, a few things happen:

  • A class of "loading" is applied to the main AutoSuggest ul while the data is loaded. That class is then removed when all processing has finished and before the suggestion results list is made visible.
  • As you hover over each suggested option in the list a class of "selected" is added to that item, and then removed when you mouseout.
  • When you make a selection the item is added to the input box. Also there is a hidden input field generated for each AutoSuggest box that stores the values (comma separated) of each item you have selected. This input box will have a unique ID as well as a class name of "as-values".

The plugin expects the Data passed into it (or gathered from the URL) to be formatted in JSON. JSON is an extremely easy format to work with, and if you don't already... you should :) To learn more about JSON, check out my post/video, An Introduction to JSON.

When an AJAX request is made the search string is sent over in a param named "q" by default. However you can change that name with the queryParam option. Here is a default example AJAX request: http://www.mysite.com/your/script/?q=mick
"mick" would be the search query that was typed into the input box. Be sure to setup your server-side code to grab that param and send back some results.

As of AutoSuggest version 1.4 you can now create selections by using the tab or comma keys. To do this simply type something into the box and hit the tab or comma keys. The selection is added to AutoSuggest in the exact same manner as if it were chosen from the Results dropdown.

AutoSuggest has been tested (and works) in: IE7 & IE8, Firefox, Safari, Opera, and Chrome.

How To Use It

Obviously you need to make sure you have the latest jQuery library (at least 1.3) already loaded in your page. After that it's really simple, just add the following code to your page (make sure to wrap your code in jQuery's ready function):

1.$(function(){
2.    $("input[type=text]").autoSuggest(data);
3.});

The above line of code will apply AutoSuggest to all text type input elements on the page. Each one will be using the same set of Data. If you want to have multiple AutoSuggest fields on your page that use different sets of Data, make sure you select them separately. Like this:

1.$(function(){
2.    $("div.someClass input").autoSuggest(data);
3.    $("#someID input").autoSuggest(other_data);
4.});

Doing the above will allow you to pass in different options and different Data sets.

Below is an example of using AutoSuggest with a Data Object and other various options:

01.var data = {items: [
02.    {value: "21", name: "Mick Jagger"},
03.    {value: "43", name: "Johnny Storm"},
04.    {value: "46", name: "Richard Hatch"},
05.    {value: "54", name: "Kelly Slater"},
06.    {value: "55", name: "Rudy Hamilton"},
07.    {value: "79", name: "Michael Jordan"}
08.]};
09.$("input[type=text]").autoSuggest(data.items, {selectedItemProp: "name", searchObjProps: "name"});

Below is an example using a URL to gather the Data Object and other various options:

1.$("input[type=text]").autoSuggest("http://mysite.com/path/to/script", {minChars: 2, matchCase: true});

Please not that you MUST have an object property of "value" for each data item. (This is now configureable with the selectedValuesProp option). The "value" property will be stored (comma separated) in the hidden input field when chosen from the "suggestion" dropdown list. You can see an example of the "value" property being set for each data item in the example above. Typically the "value" property would contain the ID of the item, so you can send a list of "chosen" IDs to your server.

Below is an example of how to process the data sent via AJAX to your server in PHP:

01.<?
02.    $input = $_GET["q"];
03.    $data = array();
04.    // query your DataBase here looking for a match to $input
05.    $query = mysql_query("SELECT * FROM my_table WHERE my_field LIKE '%$input%'");
06.    while ($row = mysql_fetch_assoc($query)) {
07.        $json = array();
08.        $json['value'] = $row['id'];
09.        $json['name'] = $row['username'];
10.        $json['image'] = $row['user_photo'];
11.        $data[] = $json;
12.    }
13.    header("Content-type: application/json");
14.    echo json_encode($data);
15.?>

Options

  • asHtmlID: string (false by default) - Enables you to specify your own custom ID that will be appended to the top level AutoSuggest UL element's ID name. Otherwise it will default to using a random ID. Example: id="CUSTOM_ID". This is also applies to the hidden input filed that holds all of the selected values. Example: id="as-values-CUSTOM_ID"
  • startText: string ("Enter Name Here" by default) - Text to display when the AutoSuggest input field is empty.
  • emptyText: string ("No Results" by default) - Text to display when their are no search results.
  • preFill: object or string (empty object by default) - Enables you to pre-fill the AutoSuggest box with selections when the page is first loaded. You can pass in a comma separated list of values (a string), or an object. When using a string, each value is used as both the display text on the selected item and for it's value. When using an object, the options selectedItemProp will define the object property to use for the display text and selectedValuesProp will define the object property to use for the value for the selected item. Note: you must setup your preFill object in that format. A preFill object can look just like the example objects laid out above.
  • limitText: string ("No More Selections Are Allowed" by default) - Text to display when the number of selections has reached it's limit.
  • selectedItemProp: string ("value" by default) - Name of object property to use as the display text for each chosen item.
  • selectedValuesProp: string ("value" by default) - Name of object property to use as the value for each chosen item. This value will be stored into the hidden input field.
  • searchObjProps: string ("value" by default) - Comma separated list of object property names. The values in these objects properties will be used as the text to perform the search on.
  • queryParam: string ("q" by default) - The name of the param that will hold the search string value in the AJAX request.
  • retrieveLimit: number (false by default) - If set to a number, it will add a '&limit=' param to the AJAX request. It also limits the number of search results allowed to be displayed in the results dropdown box.
  • extraParams: string ("" by default) - This will be added onto the end of the AJAX request URL. Make sure you add an '&' before each param.
  • matchCase: true or false (false by default) - Make the search case sensitive when set to true.
  • minChars: number (1 by default) - Minimum number of characters that must be entered into the AutoSuggest input field before the search begins.
  • keyDelay: number (400 by default) - Number of milliseconds to delay after a keydown on the AutoSuggest input field and before search is started.
  • resultsHighlight: true or false (true by default) - Option to choose whether or not to highlight the matched text in each result item.
  • neverSubmit: true or false (false by default) - If set to true this option will never allow the 'return' key to submit the form that AutoSuggest is a part of.
  • selectionLimit: number (false by default) - Limits the number of selections that are allowed to be made to the number specified.
  • showResultList: true or false (true by default) - If set to false, the Results Dropdown List will never be shown at any time.
  • start: callback function - Custom function that is run only once on each AutoSuggest field when the code is first applied.
  • selectionClick: callback function - Custom function that is run when a previously chosen item is clicked. The item that is clicked is passed into this callback function as 'elem'.
    Example: selectionClick: function(elem){ elem.fadeTo("slow", 0.33); }
  • selectionAdded: callback function - Custom function that is run when a selection is made by choosing one from the Results dropdown, or by using the tab/comma keys to add one. The selection item is passed into this callback function as 'elem'.
    Example: selectionAdded: function(elem){ elem.fadeTo("slow", 0.33); }
  • selectionRemoved: callback function - Custom function that is run when a selection removed from the AutoSuggest by using the delete key or by clicking the "x" inside the selection. The selection item is passed into this callback function as 'elem'.
    Example: selectionRemoved: function(elem){ elem.fadeTo("fast", 0, function(){ elem.remove(); }); }
  • formatList: callback function - Custom function that is run after all the data has been retrieved and before the results are put into the suggestion results list. This is here so you can modify what & how things show up in the suggestion results list.
  • beforeRetrieve: callback function - Custom function that is run right before the AJAX request is made, or before the local objected is searched. This is used to modify the search string before it is processed. So if a user entered "jim" into the AutoSuggest box, you can call this function to prepend their query with "guy_". Making the final query = "guy_jim". The search query is passed into this function. Example: beforeRetrieve: function(string){ return string; }
  • retrieveComplete: callback function - Custom function that is run after the ajax request has completed. The data object MUST be returned if this is used. Example: retrieveComplete: function(data){ return data; }
  • resultClick: callback function - Custom function that is run when a search result item is clicked. The data from the item that is clicked is passed into this callback function as 'data'.
    Example: resultClick: function(data){ console.log(data); }
  • resultsComplete: callback function - Custom function that is run when the suggestion results dropdown list is made visible. Will run after every search query.

The formatList option will hand you 2 objects:

  • data: This is the data you originally passed into AutoSuggest (or retrieved via an AJAX request)
  • elem: This is the HTML element you will be formatting (the 'result' li item).
In order to add extra things to the 'result' item (like an image) you will need to make sure you pass that data into AutoSuggest.
Below is an example of formatList in action:
1.formatList: function(data, elem){
2.    var my_image = data.image;
3.    var new_elem = elem.html("add/change stuff here, put image here, etc.");
4.    return new_elem;
5.}

You MUST return the HTML object. formatList will run on each 'result' item.

ChangeLog

Version 1.4 (Mar. 23, 2010)
Changes:
  • When using asHtmlID, the "as-input-" is no longer prepended to the beginning of the ID name. It is now just whatever you set for asHtmlID. This adds easy Rails compatibility.
New Features:
  • Added the ability to generate new selections by hitting tab or comma after entering some text into the main input field. This was a hugely requested feature, and will make AutoSuggest even more useful.
  • Added showResultList which gives you the option to never show a results list at any time.
  • Added in beforeRetrieve callback function (see 'Options' section above for description).
  • Added in selectionAdded callback function (see 'Options' section above for description).
  • Added in selectionRemoved callback function (see 'Options' section above for description).
Version 1.3 (Feb. 07, 2010) - (watch update video above for more details)
Changes:
  • Added a new feature overview video!
  • The hidden input field that holds all the values (class name of 'as-values') now has it's own ID, defined by the asHtmlID option. Example: id="as-values-CUSTOM_ID". If the asHtmlID is not set, it will revert to a random number ID identifier ("as-values-RANDOM").
  • Changed the option selectedItem to selectedItemProp to make better sense.
  • Changed the option searchObj to searchObjProps to make better sense.
  • Changed "Lucdia Grande" to "Lucida Grande" in CSS (bug fix).
  • Fixed bug that would prevent you from adding certain selections at seemingly random times.
New Features:
  • Added preFill option that allows you to pre-fill the AutoSuggest box with selections when the page is loaded.
  • Added asHtmlID option that allows you to specify your own custom ID that will be appended to the top level AutoSuggest UL element's ID name. Otherwise it will default to using a random ID.
  • Added emptyText option to customize "No Results" text.
  • Added resultsHighlight option to choose whether or not to highlight the matched text in the result items.
  • Added neverSubmit option. This will never allow the 'return' key to submit the form that AutoSuggest is a part of.
  • Added resultClick callback function. This will run a custom function when a result item has been clicked. It also hands you the data associated with that result item.
  • Added selectionLimit option so you can limit the number of selections that are allowed to be made.
  • Added limitText option to customize "No More Selections Are Allowed" text.
  • retrieveLimit now works with local objects and will limit the results to the number specified.
  • Added selectedValuesProp option to specify the property you want to use to store the values into the hidden input field.
  • Added in dynamic width for the results UL (description in video above).
  • Added packed version of the JS (only 6kb!)
Version 1.2 (Jan. 05, 2010)
  • Fixed bug that didn't properly use the selectedItem option as the text for the results list (thanks @Niki for finding it).
  • searchObj now has it's white-space removed so it will no longer error if you do: searchObj: "value, prop, cool".
  • Also, added in selectionClick callback function (see 'Options' section above for description).
Version 1.1 (Jan. 02, 2010)
  • Fixed CSS and visuals for Firefox 3.0.
  • Added in the following options: queryParam, extraParams
Version 1.0 (Dec. 28, 2009)
  • Initial release.