36
인사말,Jquery : Autocomplete 위젯의 소스를 동적으로 변경할 수 있습니까?
공식 자동 완성 jquery 위젯을 사용하고 있으며 동적으로 변수 (selectType)를 변경하는 데 문제가 있습니다. 쿼리 문자열을 통해 전달하고 있습니다. 변수는 선택 상자를 통해 선택된 옵션에 따라 변경됩니다.
$(function() {
var selectType = $('#selectType option:selected').attr("value");
$("#selectType").change(function(){
selectType = $('#selectType option:selected').attr("value");
alert (selectType); // alerts the right value for debugging
});
$("#address").autocomplete({
source: "ajaxSearchForClientAddress.php?selectType="+selectType,
minLength: 3
});
});
지옥 예, 감사합니다! – Ryan
멋진 남자! 여기에 나를 구해 줬어 ... –
너는 대단해 !! 나는 이것을 알아 내려고 3 일을 보냈다. 감사합니다. – liveandream