我在使 jQuery 的结果Autocomplete
可点击时遇到问题。首先这是我在 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());
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 作为值传递到数组中来做到这一点是否正确?
这是我的http://jsfiddle.net/Lszkb/4/包含其余的 js 和 html .. 请帮我解决这个问题。我发现了很多关于这个问题的问题,但没有一个给我答案。还有别的东西 - window.location 根本不起作用..谢谢你们的任何帮助和建议