Đang chuẩn bị liên kết để tải về tài liệu:
Practical prototype and scipt.aculo.us part 48

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Using Autocompleter comes in two flavors. One, named Autocompleter. Local, keeps an array of possible suggestions for instantaneous feedback. The other, Ajax. Autocomleter, relies on a remote server to give it suggestions - making an Ajax call whenever suggestion need to be retrieved | CHAPTER 12 ADVANCED CONTROLS AUTOCOMPLETERS IN-PLACE EDITORS AND SLIDERS 279 Using Autocompleter Autocompleter comes in two flavors. One named Autocompleter.Local keeps an array of possible suggestions for instantaneous feedback. The other Ajax.Autocompleter relies on a remote server to give it suggestions making an Ajax call whenever suggestions need to be retrieved. Naturally Autocompleter.Local has less overhead since it does not need to talk to the server as a result its suggestions will usually appear far more quickly. You ll only want to fall back to Ajax.Autocompleter if the pool of suggestions is simply too large to keep on the client side or if the logic for picking suggestions is more complicated than an ordinary string match. We ll cover these cases several pages from now but for now let s use the local version for simplicity s sake. Using Autocompleter.Local The syntax for declaring a new Autocompleter.Local is new Autocompleter.Local inputElement updateElement array options where inputElement is the text box updateElement is the element that will hold the suggestions array is the list of possible suggestions and options is the configuration object we ve come to know so well. Let s add a script tag to the page and declare an Autocompleter.Local on page load script type text javascript document.observe dom loaded function new Autocompleter.Local player_name player_suggestions James Polk James Buchanan Franklin Pierce Millard Fillmore Warren Harding Chester Arthur Rutherford Hayes Martin Van Buren script Our array contains a short list of nonnotable American presidents the benchwarmers of our fictional league. Rather than make the user choose from an endless drop-down menu or force her to remember how many Is are in Fillmore Autocompleter will offer possible name completions after only a few keystrokes. Save index.html and open it in a browser. You ll see a text box of course as shown in Figure 12-1. 280 CHAPTER 12 ADVANCED CONTROLS AUTOCOMPLETERS .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.