I am getting this message
Uncaught Exception Object #displayusersearch2 has no method ‘html’
The code is:
<script src="../../javascript/jqueryfunctions.js" type="text/javascript"></script>
<script src="../../jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
function uid_id_search_change()
{
var search=document.getElementById('uid_id_search').value;
$.get('userdisplaypopup.php?id='+search,userset);
}
function userset(res)
{
('#displayusersearch2').html(res);
Uncaught TypeError: Object #displayusersearch2 has no method 'html'
}
</script>
<table width="600" border="0">
<tr>
<th scope="row"><font size="-1">Book Id</font></th>
<td><input type="text" value="1" id="bid_popup" /></td>
</tr>
<tr>
<th scope="row"><font size="-1">Book Name</font></th>
<td><input type="text" value="1" /></td>
</tr>
<tr>
<th scope="row"><font size="-1">Author</font></th>
<td><input type="text" value="1" /></td>
</tr>
<tr>
<th scope="row"><font size="-1">Publisher</font></th>
<td><input type="text" value="1" /></td>
</tr>
<tr>
<th scope="row">Search User</th>
<td><input type="text" id="uid_id_search" name="uid_id_search" onkeyup="uid_id_search_change();" />
<div id="displayusersearch2"></div></td>
</tr>
</table>
The id of the div is displayusersearch2. The request is sending correctly. I am trying to get the response to be displayed on the div displayusersearch2.
You omitted the
$that makes that a jQuery wrapper call. Without it, this is nothing more than a String literal. The string'#displayusersearch2'does not have anhtml()method.Also,
will fail for any
searchterm with a URL-special character in it. Suggest usingencodeURIComponent(), or let jQuery do it for you: