I think: This function can solve the problem that onchange,onpropertychange,oninput is incompatible in the mainstream browser.
This feature is used to quickly blur find and add data
When the "T" letter is entered, a real-time list of 10 item names, spelling, model and other fields containing the T-letter data
Of course, you can enter Chinese character query, include more field fuzzy query, list more data and sort by some (out frequency, usage frequency) field.
When you re-enter "V", reload the data list and navigate to an item.
Click the plus sign
Added to the BOM list. and can be deleted
I prefer to write JS, but limited ability to write such a function. It also took a lot of effort.
The implementation function mainly uses the window.onload () function, SetInterval ("function name", MS) function, Jquery.ajax get the data. (to refer to the framework of jquery)
The SetInterval () function is equivalent to a clock in WinForm, and it takes too long to execute a function once, until the clearinterval () function executes, clearinterval () is not used, so it is not delved into.
Write the implementation process
1.window.onload () initializes the public variable. Execute SetInterval ("ShowData ()", 100), execute ShowData () function every 100 milliseconds
The 2.showdata () function determines whether there are keywords in the query text box, if not, skips, hides the data list, and then executes step 3rd.
3. Assign a keyword to a public variable, such as Currentkeyword, and save it as the next time you enter the function and the keyword does the same judgment, if the same is skipped, the difference is to perform the 4th step. (If this is not the case, the data list will always be assigned a value, affecting performance).
4.jquery.ajax gets the data, populates the data list, and displays the list of data.
5. End.
The code is not affixed, because the reference to the external CSS and scripts, can not be perfectly presented to you. If necessary, please leave a message or add: WANGXIHUI_GXFC
At the same time welcome the Big God small God pointing point.
Note: The title is to attract people to see.
This is the perfect solution for real-time monitoring of changes in input box values