I have the following code:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#property').keyup(function() {
var query = $(this).val();
$('#results').html(query);
$.getJSON('InstantSearchServlet?property=' + query, null, callBackProperty);
}
});
});
For some reason the InstantSearchServlet is never getting called but when I directly call the se开发者_如何学Pythonrvlet by editing the url to /InstantSearchServlet?property=e for example I get the desired result. I have tried putting a / before InstantSearchServlet... and that doesn't change anything.
Thanks.
Instead of .val(), try .html() or .text()
精彩评论