In the work need to use the automatic prompt this function, hehe, oneself is JS vegetable, so Baidu a bit, find a with jquery and its plug-in autocomplete development of the. NET version of the automatic completion function, so down to the PHP version, and added support up/ Down to select text and other functions, put up to share, pure physical life ... :)
1, download jquery library, url: http://jquery.com/;
2, download the jquery
In the introduction of jquery AutoComplete components, encountered JS report not end string constant error, the reasons and solutions are as follows, we can refer to the following
On my question and the solution:
When I introduced the AutoComplete component of jquery, I encountered the JS report not ending string constant error.
Cause analysis: First, right-click Page view encoding is Utf-8,
Second, loo
Ajax
"Guide" This article describes how to achieve the function of Ajax automatic completion, that is, AutoComplete, for example, in the search box to enter a product model, you can see the effect.
The function that completes automatically is AutoComplete, the concrete example can look here: http://www.b2c-battery.co.ukEnter
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
the next articlenew Python environment variable configuration file:under the host user directoryvim. Pystartup# ADD Auto-completion and a stored history file of commands to your Python# Interactive interpreter. Requires Python 2.0+, ReadLine. Autocomplete is# bound to the ESC key by default (you can change It–see readline docs).# Store The file in ~/.pystartup, and set a environment variable to point# to it: ' Export pythonstartup=~/.pystartup ' in ba
Eva is used to return data in JSON format
Array Implementation AutoComplete function similar to Baidu search boxTest. aspx in the background returns a string to the foregroundVaR DATA = "core | selectors | attributes | traversing | manipulation | CSS | events effects | Ajax utilities ";Response. Clear ();Response. Write (data );Response. End ();Use the split () method to convert data to an array. Add a text box with ID txtnamecn to the page. /////
The auto-Prompt function is required in work. Haha, I am a js dish, So Baidu finds a plug-in developed with jquery AND ITS autocomplete. net version of the Automatic completion function, so down to change to the php version, and added support for up/down select text and other features, put up to share, pure physical activity... :)1. Download jquery library, URL: http://jquery.com /;2. Download The jquery autocompl
For jquery autocomplete and database connections, that is, data from the database?? Urgent and urgent
jquery AutoComplete Code:
The following code inside the search is dead, I want to according to the input content to go to the database query, the database is MySQL, the development environment is PHP
jquery's Ajax AutoComplete feature allows you to easily create text entry fields for automatic completion/Auto prompt boxes . It is initially built to show the duplicate query results for each query cache being the same from the local cache. If there are no results for a particular query, it stops sending requests to the server for additional queries.
Ajax's automatic completion of jquery is freely distributed under the terms of the MIT-style licen
HighlightColor: "#3399FE",//color when highlighted
Unhighlightcolor: "#FFFFFF",//color when not highlighted
Css:cssoptions,
DataType: "xml",//ajax request return data type
ParamName: "word",//ajax the requested parameter name, if you have the ID of the Set Text field, use this property
delay:500,//when the text field is constantly entered, how often does Ajax request a server
};
Keys are the corresponding values of keyboard keys;
AutoC
This example describes the jquery plug-in AutoComplete usage. Share to everyone for your reference, specific as follows:
(1) Introduction of JS and style
(2) AutoComplete of the front desk JS
(3) Background JSON returns with SPRINGMVC
@ResponseBody
@RequestMapping (value = "/search/fuzzy/pkword.html", method = requestmethod.get) public
List
More interested readers of
Keep in mind the way you used the jquery autocomplete. 1. First define a text box
2. Script
$ ("#statName"). AutoComplete ({source:function (request,response) {$.ajax ({
Type: "POST", url: "
3, Background action returns JSON format data,
Get param asynchronously Load site drop-down list String statname = Urldecoder.decode (Request.getparameter ("statname") = = null?
"":
During project creation, you sometimes need to provide users with certain help information to prompt user operations. Of course, the suggest function is essential, but if you develop it yourself, it is time-consuming and time-consuming. Here we will use JQuery's autocomplete directly. The experiment proves that the result is very good. The front-end code is as follows:
The Code is as follows:
JQuery's Automatic completion Function
The jquery-based text box and autocomplete are used in combination with the sample code. If you need this code, you can refer to the JS Script Reference.
The Code is as follows:
In addition, the implementation principle of AutoComplete auto-completion is mainly implemented in the asp.net background. Considering the performance, it is best to generate xml and merge it into the cache. I. Brief Introduction
Yesterday, a support Colleague helped her customer achieve the following results (automatically completed ):
I used to call the real estate dictionary when I searched for the house:
This is a small feature and a large feat
In addition, the implementation principle of AutoComplete auto-completion is mainly implemented in the asp.net background. Considering the performance, it is best to generate xml and merge it into the cache. I. Brief Introduction
Yesterday, a support Colleague helped her customer achieve the following results (automatically completed ):
I used to call the real estate dictionary when I searched for the house:
This is a small feature and a large feat
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.