Jquery-autocomplete configuration:
The first is the simplest AutoComplete (auto-complete) code fragment:
Copy Code code as follows:
The result method is an important method in the jquery AutoComplete plug-in, which is triggered when a user selects an item. The data parameter is selected.
A slightly more complex example, you can customize
Based on the Bootstrap plug-in implementation AutoComplete automatic completion of the form, providing scripting code, use cases, as well as the backend server (PHP), some of the original text is not clear place, I hope to help you.
First of all, it must be loaded bootstrapjquery, it is necessary to note that the back-end of the two-dimensional array, and the Formatitem method is consistent with the following calls;In addition, the returned data firs
Sample 1: Normal situation, that is, the default, open when AutoComplete. See: ie5-Tool-Content-autocomplete option.
Sample 2: Sometimes we don't need autocomplete, such as requiring users to enter them again instead of automating them. Just set the AutoComplete property of the form element that you are on to off.
Samp
:
Appendchild:function (data) {var self = this;
var data = data;
var fragment = Document.createdocumentfragment ();
for (var i = 0; i
The above is the main idea of a few steps, now look at how to encapsulate the code into an object, let it become plug-ins. This is where we use anonymous closures:
(function (Win) {
var autocomplete= function () {this
. Init.apply (this, arguments);
Autocomplete.prototype =
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
Nevermodules-autocomplete
Cross-browserIE 6.0-opera 9.0--Mozilla 1.5.0
Example List
Google suggest demo in this e.g
Response speed test, this e.g
Using AutoComplete in Ajax, e.g
Nevermodules online Document e.g
Feature characteristics (my English is poor, I
Google AutoComplete is created in ten minutes. Because it is created in ten minutes, only the surface effect is taken into consideration. All others are ignored. . Conventional discussion --- XmlHttpRequest
Code
The Code is as follows:
Var xmlHttp;Function createXmlHttpRequest (){If (window. ActieveXObject){XmlHttp = new ActieveXObject ("Microsoft. XMLHTTP ");}Else if (window. XMLHttpRequest){XmlHttp = new XMLHttpRequest ();}}
If you do not need J
File Name:
Jquery autocomplete. js
Method of modification: Add the following code in row 200th
We only need to insert the following code around 199th lines in the original jquery. autocomplete. JS:
. BIND ("input", function (){
// @ Hack by liqt: Support for inputing Chinese Characters in Firefox
Onchange (0, true );
});
Copy code
This is the last line of the
PHP development framework YiiFramework tutorial (34) Zii component-AutoComplete example
CJuiAutoComplete can automatically prompt users to enter text based on the first few characters. It encapsulates the JUI autocomplete plug-in.
The basic usage is as follows:
$ This-> widget ('zii. widgets. jui. CJuiAutoComplete ', array ('Name' => 'city ','Source' => $ data,// Additional javascript options for the
Jquery. autocomplete plugin extends the scroll bar to load more
The autocomplete plug-in is used in the project, but the original functions of the plug-in cannot meet all project requirements. Therefore, the following functions are added:
1. paste text to automatically load data
2. scroll to the bottom to load more data.
3. associate with the page plug-in to update data (clear cache)
4. Add a plug-in value
Example of jquery plug-in autocomplete usage, jqueryautocomplete
This example describes how to use the jquery plug-in autocomplete. We will share this with you for your reference. The details are as follows:
(1) Introduce js and styles
(2) autocomplete front-end js
(3) return the background json with springmvc
@ResponseBody@RequestMapping(value = "/search/fuzzy
This essay was supposed to have been published as early as two weeks ago, just because an error occurred while saving it after the last writing (not saved as a draft in advance). Sadly, I wrote it for half an hour.
AutoComplete is similar to Google search prompts. The implementation in winform is slightly different from that in web. Last year, I wrote a script class to adapt to AutoComplete on the web, b
The AutoComplete attribute of input is on by default. It indicates whether to allow the browser to automatically record the previously entered value.In many cases, you need to keep the customer's information confidential to prevent the browser software or malicious plug-ins from obtainingYou can add AutoComplete = "off" to input to close records.This parameter can be used when the system requires confidenti
Recently in a bug as described in the title, Chrome browser when the input tag opens AutoComplete, the background color of input is yellow and the background image of input is also overwritten. For this reason Baidu a long time to find online said using JS to append operation, the pro-test is not working. Unless the autocomplete= "off" is turned off, it doesn't fit the demand.Web-based changes-webkit-autofi
Title Description:Autocompletepoints
Since Crave State-of-the-art technology, you ' ve just purchased a phone with a great new feature:autocomplete! Your phone ' s version of AutoComplete has some pros and cons. On the one hand, it ' s very cautious. It is only autocompletes a word if it knows exactly what do you ' re trying to write. On the other hand, you have to teach it every word you want to use.You have N distin
attribute that is used to associate a specific AutoComplete class. When AutoComplete is enabled, you do not need to repeat common information in the self-love form. If the browser AutoComplete is not disabled, the browser prompts the user to enter the same value as the previous one. (Even if you enter form fields in different websites) The Code is as follows:
Usually with Baidu, Google search when there will be a drop-down list to prompt this is a very good feature this article is to introduce the jquery plugin called Ajax Autocomplete as the name implies that Ajax is the Ajax way to get the search hint information and then return to the renderedGossip doesn't say much directly on the codeThe files used in this article are:1, click Ajax Autocomplete for JQuery,
Auto-associative full effect based on jquery text box. This is a simple to use jquery AutoComplete plug-in, you can define index keywords, you can set the width of the input box, support search callback function. As follows:Online preview Source DownloadThe implemented code.HTML code:DivID= "Demo"> Divclass= "wrapper"> H3>Try typing "love programming."H3> DivID= "Search-form">Div> DivID= "message">Div> Div>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.