Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
AJAX Suggest and Autocomplete crtLink = crtLink.replace("-", "_"); crtLink = crtLink.substring(0, crtLink.length - 4); // update the keyword's value oKeyword.value = unescape(crtLink.substring(phpHelpUrl.length, crtLink.length)); } /* function that removes the style from all suggestions*/ function deselectAll() { for(i=0; i | AJAX Suggest and Autocomplete crtLink crtLink.replace - _ crtLink crtLink.substring 0 crtLink.length - 4 update the keyword s value oKeyword.value unescape crtLink.substring phpHelpUrl.length crtLink.length function that removes the style from all suggestions function deselectAll for i 0 i suggestions i var oCrtTr document.getElementByld tr i oCrtTr.className function that handles the mouse entering over a suggestion s area event function handleOnMouseOver oTr desel ectAl l oTr.className highlightrow position oTr.id.substring 2 oTr.id.length function that handles the mouse exiting a suggestion s area event function handleOnMouseOut oTr oTr.className position -1 function that escapes a string function encode uri if encodeURlComponent return encodeURlComponent uri if escape return escape uri function that hides the layer containing the suggestions function hideSuggestions var oScroll document.getElementByld scroll oScroll.style.visibility hidden function that selects a range in the text object passed as parameter function selectRange oText start length check to see if in IE or FF if oText.createTextRange IE var oRange oText.createTextRange oRange.moveStart character start oRange.moveEnd character length - oText.value.length oRange.select 180 Chapter 6 el se FF if oText.setSelectionRange oText.setSelectionRange start length oText .focus function that autocompletes the typed keyword function autocompleteKeyword retrieve the keyword object var oKeyword document.getElementByld keyword reset the position of the selected suggestion position 0 deselect all suggestions desel ectAl l highlight the selected suggestion document.getElementByld trO .className hi ghlightrow update the keyword s value with the suggestion updateKeywordValue document.getElementByld trO apply the type-ahead style selectRange oKeyword httpRequestKeyword.length oKeyword.value.length set the autocompleted word to the keyword s value autocompletedKeyword oKeyword.value function that displays an error .