드롭 다운 메뉴 (demo here)에서 여러 항목을 선택할 수있는 autosuggest 플러그인을 사용하고 있습니다. 쿼리를 PHP 파일로 보내고 싶습니다 (나중에 쿼리 자체에 몰입하게됩니다). 페이지를 떠나지 않고 결과를 얻으십시오. 이 배열을 PHP로 보내고 div (FCBKcomplete)로 결과를 얻으십시오.
PHP 파일
지금은 거의 비어 :<?php print_r($_REQUEST); ?>
하지만 검색 상자가 displaying properly anymore이 아니기 때문에 어디 선가 내 jQuery로 실수를 알고있다.
내가 작성한 코드는 다음과 같습니다. "데이터"입력란에 무엇을 입력해야할지 모르겠습니다.
<script type="text/javascript">
$(document).ready(function(){
$("#select3").fcbkcomplete({
json_url: "data.txt",
addontab: true,
maxitems: 10,
input_min_size: 0,
height: 10,
cache: true,
newel: false,
filter_selected: true,
maxitimes: 5,
// I did this
onselect:"get_venue",
});
// I also did this
function get_venue() {
$("#select3 option:selected").each(function() {
$.ajax({
type: 'POST',
url: 'post.php',
dataType: 'json',
data: {
WHAT DATA GOES HERE?
},
success : function(data){
$('#phpmessage').removeClass().addClass((data.error === true) ? 'error' : 'success')
.text(data.msg).show(500);
if (data.error === true)
},
error : function(XMLHttpRequest, textStatus, errorThrown) {
$('#waiting').hide(500);
$('#phpmessage').removeClass().addClass('error')
.text('There was an error.').show(500);
}
});
});
}
});
</script>
그런 긴 게시물에 대해 죄송합니다. 감사합니다 :))
오류 내가 갖는 :
는 함수가 아닙니다 : 반환 func.call (FUNC, _object);
function funCall(func, item) {
var _object = {};
for (i = 0; i < item.get(0).attributes.length; i++) {
if (item.get(0).attributes[i].nodeValue != null) {
_object["_" + item.get(0).attributes[i].nodeName] = item.get(0).attributes[i].nodeValue;
}
}
return func.call(func, _object);
}
function checkFocusOn() {
if (focuson == null || focuson.length == 0) {
return false;
}
return true;
}
콘솔에 오류가 있습니까? –
예, '어떤 데이터가 여기에 있습니까?' 나는 실제로 어떤 데이터를 보내야할지 모르기 때문에 의도적으로 그 것을 넣었습니다./ – user944589