代码示例:(标识:jquery_ajax_load_data)
<html>
<head>
<script type="text/javascript" src="/jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $("input").keyup(function(){
    txt=$("input").val();
    $("span").load("/static/demo/php/gethint.php",{suggest:txt});
  });
});
</script>
</head>
<body>
<p>请在下面的输入框中输入名字(a 到 z 的字符):</p>
名字:<input type="text" />
<p>建议:<span></span></p>
<p>注释:我们在 <a href="/ajax/ajax_asp_php.html" target="_blank">AJAX 教程</a> 中讲解过本例中使用的文件(gethint.php)。</p>
</body>
</html>
运行结果: