php div 数组,将此数组发送到php并在div中获取结果(FCBKcomplete)

我使用的autosuggest插件允许我从下拉菜单中选择多个项目(demo here)。我希望将查询发送到一个php文件(我将在以后专注于查询本身),并在不离开页面的情况下返回结果。

这个php文件现在几乎是空的:

<?php print_r($_REQUEST); ?>但我知道我在我的jquery上犯了一个错误,因为搜索框不是displaying properly anymore。

这是我建立的代码,我不知道要在“数据”字段中放置什么。

$(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);

}

});

});

}

});

对不起,这么长的帖子大家:)!谢谢 :))

错误我得到:

不是函数:return 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;

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值