【发布时间】:2012-08-16 14:13:29
【问题描述】:
我有一个类似的搜索表单 -
我想要做的是使用 jquery 和 php 来获得结果,因为用户更改了任何表单元素的值,但我只能在所有表单元素都被视为单个并且没有其他选项时才能这样做.但我想在任何表单值发生变化时触发偶数。
google.load("jquery", "1.3.1");
google.setOnLoadCallback(function()
{
// Safely inject CSS3 and give the search results a shadow
var cssObj = { 'box-shadow' : '#888 5px 10px 10px', // Added when CSS3 is standard
'-webkit-box-shadow' : '#888 5px 10px 10px', // Safari
'-moz-box-shadow' : '#888 5px 10px 10px'}; // Firefox 3.5+
$("#suggestions").css(cssObj);
// Fade out the suggestions box when not active
/*$("input").blur(function(){
$('#suggestions').fadeOut();
});*/
});
function lookup(inputString) {
if(inputString.length == 0) {
$('#suggestions').fadeOut(); // Hide the suggestions box
} else {
$.post("regularsearch.php", {queryString: ""+inputString+""}, function(data) { // Do an AJAX call
$('#suggestions').fadeIn(); // Show the suggestions box
$('#suggestions').html(data); // Fill the suggestions box
});
}
}
上面是我的一个元素搜索的 jquery。如何一次搜索全部?
【问题讨论】: