jquery自动完成的可点击结果
我在使jQuery的结果可点击时遇到问题。首先,这是php文件中的内容:jquery自动完成的可点击结果,jquery,jquery-ui,autocomplete,Jquery,Jquery Ui,Autocomplete,我在使jQuery的结果可点击时遇到问题。首先,这是php文件中的内容: $q = strtolower($_GET["term"]); $return = array(); $query = mysql_query("SELECT id,title,unique_name,product FROM products WHERE product LIKE '%$q%' AND active='1' LIMIT 11") or die(mysql_error()); whi
$q = strtolower($_GET["term"]);
$return = array();
$query = mysql_query("SELECT id,title,unique_name,product FROM products WHERE product LIKE '%$q%' AND active='1' LIMIT 11") or die(mysql_error());
while ($row = mysql_fetch_array($query)) {
array_push($return,
array('label'=>$row['product'],
'value'=>'./shop/index.php?product="'.$row['unique_name'].'">'.$row['product']));
}
echo(json_encode($return));
是否需要将url作为参数添加到数组中
我将url作为值传递到数组中,这样做是否正确
这是我的文章,包含了js和html的其余部分。。请帮帮我
来解决这个问题。我在这个问题上发现了很多问题,但没有一个能给我答案。还有一件事——window.location根本不起作用。。
感谢大家提供的帮助和建议您的代码在要指定的对象值方面存在多个问题 我试图通过以JSON格式传递Ajax请求来找到解决方案
source: function (request, response) {
$.ajax({
url: "your link",
dataType: "json",
data: {
style: "full",
maxRows: 12,
name_startsWith: request.term
},
测试时,将您的链接
替换为您的。我希望它能起作用
以下工作样本:
如果您想以不同的方式接近,请告诉我,只需在注释中指定。您是否需要演示中的多值功能?如果没有,这就容易多了。