<script>
function loadXMLDoc() {
$("input[class=search]").bind("keyup",function(){
$.get("search.php?search="+$(this).val(),
function(data){
if(data==1) {
alert("this is valid search")
} else {
alert("this is a right user search");
}
}
);
});
}
</script>
下面是按钮图像代码
<table width="165" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<img src="images/search_box_left_im.png" width="3" height="28" />
</td>
<td class="inputbox_bg" width="118px">
<input type="text" name="search" class="username">
</td>
<td>
<input type="image" onclick="loadXMLDoc()" src="images/search_go_btn.png" border="0" width="44" height="28" />
</td>
</tr>
</table>
它正在执行该函数但不执行 ajax 代码