attasz
10-15-2010, 09:32 AM
I have a php array in a page suggest.php:
while($row = mysql_fetch_assoc($query))
{
$res[] = $row['keyword'];
}
return $res;
i have a jquery script in index.php:
$.ajax({
type:"GET",
url:"incs/search.php",
data: "keywords=" + data + "&submit=Find",
success:function(html){
//this is where i'd like to make the array from $res
}
});
Basically i send a request to suggest.php via jquery ajax,and i get an answer,that is $res.The problem is that i can't figure out how to make a jquery array form $res. I tried :
var hits = $.makeArray(html);,and a few other things,but none of them worked.
Please help me.
while($row = mysql_fetch_assoc($query))
{
$res[] = $row['keyword'];
}
return $res;
i have a jquery script in index.php:
$.ajax({
type:"GET",
url:"incs/search.php",
data: "keywords=" + data + "&submit=Find",
success:function(html){
//this is where i'd like to make the array from $res
}
});
Basically i send a request to suggest.php via jquery ajax,and i get an answer,that is $res.The problem is that i can't figure out how to make a jquery array form $res. I tried :
var hits = $.makeArray(html);,and a few other things,but none of them worked.
Please help me.